-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Developer Guide Networks
Wenqi Li edited this page Apr 12, 2022
·
1 revision
(work in progress)
monai.networks
consists of nets
, blocks
and layers
sub-modules that correspond to
- network model implementations,
- reusable building blocks,
- essential differentiable component, respectively.
blocks
is implemented as a pytorch module with one or multiple layers
.
nets
is implemented as a pytorch module with one or multiple layers
and blocks
.
- compositional design to create complex networks
- 1d/2d/3d with the factories https://github.com/Project-MONAI/MONAI/blob/dev/monai/networks/layers/factories.py
dimension = 3
name = Conv.CONVTRANS
conv = Conv[name, dimension]
- flexible layer configuration https://github.com/Project-MONAI/MONAI/blob/dev/monai/networks/layers/utils.py
from monai.networks.layers import get_act_layer
s_layer = get_act_layer(name="swish")
p_layer = get_act_layer(name=("prelu", {"num_parameters": 1, "init": 0.25}))
- support of torchscript
- basic input/output shape and datatype tests, e.g. https://github.com/Project-MONAI/MONAI/blob/dev/tests/test_se_block.py
- torch script tests, e.g. SE block test case
- network integration tests https://github.com/Project-MONAI/MONAI/blob/dev/tests/test_network_consistency.py