(self)
| 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() |
no test coverage detected