@@ -332,12 +332,17 @@ class AHNet(nn.Module):
332
332
"""
333
333
AHNet based on `Anisotropic Hybrid Network <https://arxiv.org/pdf/1711.08580.pdf>`_.
334
334
Adapted from `lsqshr's official code <https://github.com/lsqshr/AH-Net/blob/master/net3d.py>`_.
335
- The model supports 2D or 3D inputs, as for the original 3D version.
335
+ Except from the original network that supports 3D inputs, this implementation also supports 2D inputs.
336
+ According to the `tests for deconvolutions <https://github.com/Project-MONAI/MONAI/issues/1023>`_, using
337
+ ``"transpose"`` rather than linear interpolations is faster. Therefore, this implementation sets ``"transpose"``
338
+ as the default upsampling method.
339
+
336
340
To meet to requirements of the structure, the input size of the first ``dim-1`` dimensions should be divisible
337
- by 32 and no less than 128. If you need to use lower sizes, please reduce the largest blocks in PSP
338
- module and change the ``num_input_features`` in Final module.
339
- In addition, to utilize the "transpose" upsample mode, please ensure that the input size of the first ``dim-1`` dimensions
340
- should be divisible by 128. In order to use pretrained weights from 2D FCN/MCFCN, please call the `copy_from` function,
341
+ by 128. In addition, for linear interpolation based upsampling modes, the input size of the first ``dim-1``
342
+ dimensions should be divisible by 32 and no less than 128. If you need to use lower sizes, please reduce the
343
+ largest blocks in PSP module and change the ``num_input_features`` in Final module.
344
+
345
+ In order to use pretrained weights from 2D FCN/MCFCN, please call the `copy_from` function,
341
346
for example:
342
347
343
348
.. code-block:: python
@@ -352,7 +357,7 @@ class AHNet(nn.Module):
352
357
out_channels: number of output channels for the network. Defaults to 1.
353
358
upsample_mode: [``"transpose"``, ``"bilinear"``, ``"trilinear"``]
354
359
The mode of upsampling manipulations.
355
- Using the last two modes cannot guarantee the model's reproducibility. Defaults to ``trilinear ``.
360
+ Using the last two modes cannot guarantee the model's reproducibility. Defaults to ``transpose ``.
356
361
357
362
- ``"transpose"``, uses transposed convolution layers.
358
363
- ``"bilinear"``, uses bilinear interpolate.
@@ -364,7 +369,7 @@ def __init__(
364
369
layers : tuple = (3 , 4 , 6 , 3 ),
365
370
spatial_dims : int = 3 ,
366
371
out_channels : int = 1 ,
367
- upsample_mode : str = "trilinear " ,
372
+ upsample_mode : str = "transpose " ,
368
373
):
369
374
self .inplanes = 64
370
375
super (AHNet , self ).__init__ ()
0 commit comments