MCPcopy Create free account
hub / github.com/akhilmathurs/orchestra / __init__

Method __init__

models.py:150–162  ·  view source on GitHub ↗
(self, block, num_blocks, num_classes=10, cfg=None)

Source from the content-addressed store, hash-verified

148
149class ResNet_basic(nn.Module):
150 def __init__(self, block, num_blocks, num_classes=10, cfg=None):
151 super(ResNet_basic, self).__init__()
152 self.train_sup = (num_classes > 0)
153
154 self.in_planes = 16
155 self.conv1 = nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=1, bias=False)
156 self.bn1 = nn.BatchNorm2d(16, affine=True)
157 self.layer1 = self._make_layer(block, 16, num_blocks[0], stride=1)
158 self.layer2 = self._make_layer(block, 32, num_blocks[1], stride=2)
159 self.layer3 = self._make_layer(block, 64, num_blocks[2], stride=2)
160 self.output_dim = 512*block.expansion
161 if(self.train_sup):
162 self.linear = nn.Linear(64*block.expansion, num_classes)
163
164 def _make_layer(self, block, planes, num_blocks, stride):
165 strides = [stride] + [1]*(num_blocks-1)

Callers

nothing calls this directly

Calls 2

_make_layerMethod · 0.95
__init__Method · 0.45

Tested by

no test coverage detected