MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _make_down_layers

Method _make_down_layers

monai/networks/nets/segresnet.py:103–117  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

101 self.dropout = Dropout[Dropout.DROPOUT, spatial_dims](dropout_prob)
102
103 def _make_down_layers(self):
104 down_layers = nn.ModuleList()
105 blocks_down, spatial_dims, filters, norm = (self.blocks_down, self.spatial_dims, self.init_filters, self.norm)
106 for i, item in enumerate(blocks_down):
107 layer_in_channels = filters * 2**i
108 pre_conv = (
109 get_conv_layer(spatial_dims, layer_in_channels // 2, layer_in_channels, stride=2)
110 if i > 0
111 else nn.Identity()
112 )
113 down_layer = nn.Sequential(
114 pre_conv, *[ResBlock(spatial_dims, layer_in_channels, norm=norm, act=self.act) for _ in range(item)]
115 )
116 down_layers.append(down_layer)
117 return down_layers
118
119 def _make_up_layers(self):
120 up_layers, up_samples = nn.ModuleList(), nn.ModuleList()

Callers 1

__init__Method · 0.95

Calls 3

get_conv_layerFunction · 0.90
ResBlockClass · 0.90
appendMethod · 0.45

Tested by

no test coverage detected