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

Method __init__

monai/networks/nets/basic_unet.py:63–88  ·  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

61 """maxpooling downsampling and two convolutions."""
62
63 def __init__(
64 self,
65 spatial_dims: int,
66 in_chns: int,
67 out_chns: int,
68 act: str | tuple,
69 norm: str | tuple,
70 bias: bool,
71 dropout: float | tuple = 0.0,
72 ):
73 """
74 Args:
75 spatial_dims: number of spatial dimensions.
76 in_chns: number of input channels.
77 out_chns: number of output channels.
78 act: activation type and arguments.
79 norm: feature normalization type and arguments.
80 bias: whether to have a bias term in convolution blocks.
81 dropout: dropout ratio. Defaults to no dropout.
82
83 """
84 super().__init__()
85 max_pooling = Pool["MAX", spatial_dims](kernel_size=2)
86 convs = TwoConv(spatial_dims, in_chns, out_chns, act, norm, bias, dropout)
87 self.add_module("max_pooling", max_pooling)
88 self.add_module("convs", convs)
89
90
91class UpCat(nn.Module):

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 1

TwoConvClass · 0.85

Tested by

no test coverage detected