MCPcopy Create free account
hub / github.com/cure-lab/deep-active-learning / __init__

Method __init__

models/resnet.py:123–141  ·  view source on GitHub ↗
(self, block, num_blocks, n_class=10, bayesian=False)

Source from the content-addressed store, hash-verified

121
122class ResNet(nn.Module):
123 def __init__(self, block, num_blocks, n_class=10, bayesian=False):
124 super(ResNet, self).__init__()
125 # self.in_planes = 16
126 self.embDim = 128 * block.expansion
127 # self.conv1 = nn.Conv2d(3, 16, kernel_size=3, stride=1, padding=1, bias=False)
128 # self.bn1 = nn.BatchNorm2d(16)
129 # self.layer1 = self._make_layer(block, 16, num_blocks[0], stride=1)
130 # self.layer2 = self._make_layer(block, 32, num_blocks[1], stride=2)
131 # self.layer3 = self._make_layer(block, 64, num_blocks[2], stride=2)
132 # self.layer4 = self._make_layer(block, 128, num_blocks[3], stride=2)
133 # self.linear = nn.Linear(128 * block.expansion, n_class)
134
135 # self.dis_fc1 = nn.Linear(512, 50)
136 # self.dis_fc2 = nn.Linear(50, 1)
137
138 self.feature_extractor = resnet_fea(block, num_blocks)
139 self.linear = resnet_clf(block, n_class)
140 self.discriminator = resnet_dis(self.embDim)
141 self.bayesian = bayesian
142
143 # def _make_layer(self, block, planes, num_blocks, stride):
144 # strides = [stride] + [1]*(num_blocks-1)

Callers 5

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 3

resnet_feaClass · 0.70
resnet_clfClass · 0.70
resnet_disClass · 0.70

Tested by

no test coverage detected