MCPcopy Create free account
hub / github.com/alinlab/SelfPatch / __init__

Method __init__

segmentation/backbones/unet.py:46–77  ·  view source on GitHub ↗
(self,
                 in_channels,
                 out_channels,
                 num_convs=2,
                 stride=1,
                 dilation=1,
                 with_cp=False,
                 conv_cfg=None,
                 norm_cfg=dict(type='BN'),
                 act_cfg=dict(type='ReLU'),
                 dcn=None,
                 plugins=None)

Source from the content-addressed store, hash-verified

44 """
45
46 def __init__(self,
47 in_channels,
48 out_channels,
49 num_convs=2,
50 stride=1,
51 dilation=1,
52 with_cp=False,
53 conv_cfg=None,
54 norm_cfg=dict(type='BN'),
55 act_cfg=dict(type='ReLU'),
56 dcn=None,
57 plugins=None):
58 super(BasicConvBlock, self).__init__()
59 assert dcn is None, 'Not implemented yet.'
60 assert plugins is None, 'Not implemented yet.'
61
62 self.with_cp = with_cp
63 convs = []
64 for i in range(num_convs):
65 convs.append(
66 ConvModule(
67 in_channels=in_channels if i == 0 else out_channels,
68 out_channels=out_channels,
69 kernel_size=3,
70 stride=stride if i == 0 else 1,
71 dilation=1 if i == 0 else dilation,
72 padding=1 if i == 0 else dilation,
73 conv_cfg=conv_cfg,
74 norm_cfg=norm_cfg,
75 act_cfg=act_cfg))
76
77 self.convs = nn.Sequential(*convs)
78
79 def forward(self, x):
80 """Forward function."""

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected