MCPcopy Create free account
hub / github.com/OUCMachineLearning/OUCML / __init__

Method __init__

Regularization/Cutout-master/model/resnet.py:41–55  ·  view source on GitHub ↗
(self, in_planes, planes, stride=1)

Source from the content-addressed store, hash-verified

39 expansion = 4
40
41 def __init__(self, in_planes, planes, stride=1):
42 super(Bottleneck, self).__init__()
43 self.conv1 = nn.Conv2d(in_planes, planes, kernel_size=1, bias=False)
44 self.bn1 = nn.BatchNorm2d(planes)
45 self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, padding=1, bias=False)
46 self.bn2 = nn.BatchNorm2d(planes)
47 self.conv3 = nn.Conv2d(planes, self.expansion*planes, kernel_size=1, bias=False)
48 self.bn3 = nn.BatchNorm2d(self.expansion*planes)
49
50 self.shortcut = nn.Sequential()
51 if stride != 1 or in_planes != self.expansion*planes:
52 self.shortcut = nn.Sequential(
53 nn.Conv2d(in_planes, self.expansion*planes, kernel_size=1, stride=stride, bias=False),
54 nn.BatchNorm2d(self.expansion*planes)
55 )
56
57 def forward(self, x):
58 out = F.relu(self.bn1(self.conv1(x)))

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected