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

Class TwoConv

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

two convolutions.

Source from the content-addressed store, hash-verified

24
25
26class TwoConv(nn.Sequential):
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 4

__init__Method · 0.90
__init__Method · 0.85
__init__Method · 0.85
__init__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…