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

Method __init__

monai/networks/nets/densenet.py:125–149  ·  view source on GitHub ↗

Args: spatial_dims: number of spatial dimensions of the input image. in_channels: number of the input channel. out_channels: number of the output classes. act: activation type and arguments. Defaults to relu. norm: feature normaliz

(
        self,
        spatial_dims: int,
        in_channels: int,
        out_channels: int,
        act: str | tuple = ("relu", {"inplace": True}),
        norm: str | tuple = "batch",
    )

Source from the content-addressed store, hash-verified

123class _Transition(nn.Sequential):
124
125 def __init__(
126 self,
127 spatial_dims: int,
128 in_channels: int,
129 out_channels: int,
130 act: str | tuple = ("relu", {"inplace": True}),
131 norm: str | tuple = "batch",
132 ) -> None:
133 """
134 Args:
135 spatial_dims: number of spatial dimensions of the input image.
136 in_channels: number of the input channel.
137 out_channels: number of the output classes.
138 act: activation type and arguments. Defaults to relu.
139 norm: feature normalization type and arguments. Defaults to batch norm.
140 """
141 super().__init__()
142
143 conv_type: Callable = Conv[Conv.CONV, spatial_dims]
144 pool_type: Callable = Pool[Pool.AVG, spatial_dims]
145
146 self.add_module("norm", get_norm_layer(name=norm, spatial_dims=spatial_dims, channels=in_channels))
147 self.add_module("relu", get_act_layer(name=act))
148 self.add_module("conv", conv_type(in_channels, out_channels, kernel_size=1, bias=False))
149 self.add_module("pool", pool_type(kernel_size=2, stride=2))
150
151
152class DenseNet(nn.Module):

Callers

nothing calls this directly

Calls 3

get_norm_layerFunction · 0.90
get_act_layerFunction · 0.90
__init__Method · 0.45

Tested by

no test coverage detected