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

Method __init__

monai/networks/nets/basic_unet.py:29–57  ·  view source on GitHub ↗

Args: spatial_dims: number of spatial dimensions. in_chns: number of input channels. out_chns: number of output channels. act: activation type and arguments. norm: feature normalization type and arguments. bias: whether

(
        self,
        spatial_dims: int,
        in_chns: int,
        out_chns: int,
        act: str | tuple,
        norm: str | tuple,
        bias: bool,
        dropout: float | tuple = 0.0,
    )

Source from the content-addressed store, hash-verified

27 """two convolutions."""
28
29 def __init__(
30 self,
31 spatial_dims: int,
32 in_chns: int,
33 out_chns: int,
34 act: str | tuple,
35 norm: str | tuple,
36 bias: bool,
37 dropout: float | tuple = 0.0,
38 ):
39 """
40 Args:
41 spatial_dims: number of spatial dimensions.
42 in_chns: number of input channels.
43 out_chns: number of output channels.
44 act: activation type and arguments.
45 norm: feature normalization type and arguments.
46 bias: whether to have a bias term in convolution blocks.
47 dropout: dropout ratio. Defaults to no dropout.
48
49 """
50 super().__init__()
51
52 conv_0 = Convolution(spatial_dims, in_chns, out_chns, act=act, norm=norm, dropout=dropout, bias=bias, padding=1)
53 conv_1 = Convolution(
54 spatial_dims, out_chns, out_chns, act=act, norm=norm, dropout=dropout, bias=bias, padding=1
55 )
56 self.add_module("conv_0", conv_0)
57 self.add_module("conv_1", conv_1)
58
59
60class Down(nn.Sequential):

Callers

nothing calls this directly

Calls 2

ConvolutionClass · 0.90
__init__Method · 0.45

Tested by

no test coverage detected