Skip to content

Commit 49fede4

Browse files
aman0311xKumoLiu
andauthored
Fix network_type docstring formatting in PerceptualLoss (#8670)
Fixes #8592 ### Description This pull request fixes incorrect formatting and clarifies the documentation for the `network_type` argument in `PerceptualLoss`. The docstring now correctly reflects the supported network options and matches the actual implementation. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [x] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [x] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. No functional behavior is changed. Signed-off-by: Mohammad Amanour Rahman <amanourrahman@gmail.com> Co-authored-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
1 parent 1ead27d commit 49fede4

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

monai/losses/perceptual.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,22 +49,27 @@ class PerceptualLoss(nn.Module):
4949
5050
Args:
5151
spatial_dims: number of spatial dimensions.
52-
network_type: {``"alex"``, ``"vgg"``, ``"squeeze"``, ``"radimagenet_resnet50"``,
53-
``"medicalnet_resnet10_23datasets"``, ``"medicalnet_resnet50_23datasets"``, ``"resnet50"``}
54-
Specifies the network architecture to use. Defaults to ``"alex"``.
52+
network_type: type of network for perceptual loss. One of:
53+
- "alex"
54+
- "vgg"
55+
- "squeeze"
56+
- "radimagenet_resnet50"
57+
- "medicalnet_resnet10_23datasets"
58+
- "medicalnet_resnet50_23datasets"
59+
- "resnet50"
5560
is_fake_3d: if True use 2.5D approach for a 3D perceptual loss.
5661
fake_3d_ratio: ratio of how many slices per axis are used in the 2.5D approach.
5762
cache_dir: path to cache directory to save the pretrained network weights.
5863
pretrained: whether to load pretrained weights. This argument only works when using networks from
59-
LIPIS or Torchvision. Defaults to ``"True"``.
64+
LIPIS or Torchvision. Defaults to ``True``.
6065
pretrained_path: if `pretrained` is `True`, users can specify a weights file to be loaded
6166
via using this argument. This argument only works when ``"network_type"`` is "resnet50".
6267
Defaults to `None`.
6368
pretrained_state_dict_key: if `pretrained_path` is not `None`, this argument is used to
6469
extract the expected state dict. This argument only works when ``"network_type"`` is "resnet50".
6570
Defaults to `None`.
6671
channel_wise: if True, the loss is returned per channel. Otherwise the loss is averaged over the channels.
67-
Defaults to ``False``.
72+
Defaults to ``False``.
6873
"""
6974

7075
def __init__(

0 commit comments

Comments
 (0)