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

Method __init__

Regularization/Cutout-master/model/resnet.py:67–77  ·  view source on GitHub ↗
(self, block, num_blocks, num_classes=10)

Source from the content-addressed store, hash-verified

65
66class ResNet(nn.Module):
67 def __init__(self, block, num_blocks, num_classes=10):
68 super(ResNet, self).__init__()
69 self.in_planes = 64
70
71 self.conv1 = conv3x3(3,64)
72 self.bn1 = nn.BatchNorm2d(64)
73 self.layer1 = self._make_layer(block, 64, num_blocks[0], stride=1)
74 self.layer2 = self._make_layer(block, 128, num_blocks[1], stride=2)
75 self.layer3 = self._make_layer(block, 256, num_blocks[2], stride=2)
76 self.layer4 = self._make_layer(block, 512, num_blocks[3], stride=2)
77 self.linear = nn.Linear(512*block.expansion, num_classes)
78
79 def _make_layer(self, block, planes, num_blocks, stride):
80 strides = [stride] + [1]*(num_blocks-1)

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls 2

_make_layerMethod · 0.95
conv3x3Function · 0.85

Tested by

no test coverage detected