MCPcopy Create free account
hub / github.com/HobbitLong/PyContrast / __init__

Method __init__

pycontrast/networks/resnet.py:89–104  ·  view source on GitHub ↗
(self, inplanes, planes, stride=1, downsample=None, groups=1,
                 base_width=64, dilation=1, norm_layer=None)

Source from the content-addressed store, hash-verified

87 expansion = 4
88
89 def __init__(self, inplanes, planes, stride=1, downsample=None, groups=1,
90 base_width=64, dilation=1, norm_layer=None):
91 super(Bottleneck, self).__init__()
92 if norm_layer is None:
93 norm_layer = nn.BatchNorm2d
94 width = int(planes * (base_width / 64.)) * groups
95 # Both self.conv2 and self.downsample layers downsample the input when stride != 1
96 self.conv1 = conv1x1(inplanes, width)
97 self.bn1 = norm_layer(width)
98 self.conv2 = conv3x3(width, width, stride, groups, dilation)
99 self.bn2 = norm_layer(width)
100 self.conv3 = conv1x1(width, planes * self.expansion)
101 self.bn3 = norm_layer(planes * self.expansion)
102 self.relu = nn.ReLU(inplace=True)
103 self.downsample = downsample
104 self.stride = stride
105
106 def forward(self, x):
107 identity = x

Callers

nothing calls this directly

Calls 3

conv1x1Function · 0.85
conv3x3Function · 0.70
__init__Method · 0.45

Tested by

no test coverage detected