From 65b61d4dd58215d4991930ea57f380618442675c Mon Sep 17 00:00:00 2001 From: Yiheng Wang Date: Mon, 11 Apr 2022 14:18:05 +0800 Subject: [PATCH 1/2] Fix doc strings error Signed-off-by: Yiheng Wang --- monai/networks/nets/dynunet.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/monai/networks/nets/dynunet.py b/monai/networks/nets/dynunet.py index 337a99acd8..329827a5e4 100644 --- a/monai/networks/nets/dynunet.py +++ b/monai/networks/nets/dynunet.py @@ -74,10 +74,15 @@ class DynUNet(nn.Module): is no less than 3 in order to have at least one downsample and upsample blocks. To meet the requirements of the structure, the input size for each spatial dimension should be divisible - by `2 * the product of all strides in the corresponding dimension`. The output size for each spatial dimension - equals to the input size of the corresponding dimension divided by the stride in strides[0]. - For example, if `strides=((1, 2, 4), 2, 1, 1)`, the minimal spatial size of the input is `(8, 16, 32)`, and - the spatial size of the output is `(8, 8, 8)`. + by the product of all strides in the corresponding dimension. In addition, the minimal spatial size should have + at least one dimension that has twice the size of the product of all strides. + For example, if `strides=((1, 2, 4), 2, 2, 1)`, the spatial size should be divisible by `(4, 8, 16)`, + and the minimal spatial size is `(8, 8, 16)` (its corresponding output is `(8, 8, 8)`) + or `(4, 16, 16)` or `(4, 8, 32)`. + + The output size for each spatial dimension equals to the input size of the corresponding dimension divided by the + stride in strides[0]. + For example, if `strides=((1, 2, 4), 2, 2, 1)` and the input size is `(64, 32, 32)`, the output size is `(64, 16, 8)`. For backwards compatibility with old weights, please set `strict=False` when calling `load_state_dict`. From 73a7f78bf9c0c87b078b9fa8fcd5a49dd9e5bae0 Mon Sep 17 00:00:00 2001 From: Yiheng Wang Date: Mon, 11 Apr 2022 14:22:21 +0800 Subject: [PATCH 2/2] remove duplicate places Signed-off-by: Yiheng Wang --- monai/networks/nets/dynunet.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/monai/networks/nets/dynunet.py b/monai/networks/nets/dynunet.py index 329827a5e4..e858dcbb9b 100644 --- a/monai/networks/nets/dynunet.py +++ b/monai/networks/nets/dynunet.py @@ -77,8 +77,7 @@ class DynUNet(nn.Module): by the product of all strides in the corresponding dimension. In addition, the minimal spatial size should have at least one dimension that has twice the size of the product of all strides. For example, if `strides=((1, 2, 4), 2, 2, 1)`, the spatial size should be divisible by `(4, 8, 16)`, - and the minimal spatial size is `(8, 8, 16)` (its corresponding output is `(8, 8, 8)`) - or `(4, 16, 16)` or `(4, 8, 32)`. + and the minimal spatial size is `(8, 8, 16)` or `(4, 16, 16)` or `(4, 8, 32)`. The output size for each spatial dimension equals to the input size of the corresponding dimension divided by the stride in strides[0].