Skip to content

Commit 7f88a46

Browse files
authored
Change default value of patch_norm to False in SwinUNETR (#8249)
Fixes #8248 ### Description Update the default value of `patch_norm` to False in `SwinUNETR` to align with the default value in `SwinTransformer`. This [change](3ee4cd2#diff-04583cc0f4aed09787775eec8cece2b1fd70290799a7a3a2671353f2a3cf9af3R105) modifies the default behavior of the model https://github.com/Project-MONAI/MONAI/blob/e6cae1ced23f32feb2f42943d15b7dd49481c794/monai/networks/nets/swin_unetr.py#L960 ### 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. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
1 parent fe3ed44 commit 7f88a46

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

monai/networks/nets/swin_unetr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(
7575
dropout_path_rate: float = 0.0,
7676
normalize: bool = True,
7777
norm_layer: type[LayerNorm] = nn.LayerNorm,
78-
patch_norm: bool = True,
78+
patch_norm: bool = False,
7979
use_checkpoint: bool = False,
8080
spatial_dims: int = 3,
8181
downsample: str | nn.Module = "merging",
@@ -102,7 +102,7 @@ def __init__(
102102
dropout_path_rate: drop path rate.
103103
normalize: normalize output intermediate features in each stage.
104104
norm_layer: normalization layer.
105-
patch_norm: whether to apply normalization to the patch embedding.
105+
patch_norm: whether to apply normalization to the patch embedding. Default is False.
106106
use_checkpoint: use gradient checkpointing for reduced memory usage.
107107
spatial_dims: number of spatial dims.
108108
downsample: module used for downsampling, available options are `"mergingv2"`, `"merging"` and a

0 commit comments

Comments
 (0)