MCPcopy Create free account
hub / github.com/breeze-sys/Label-Only-MIA-Go / __init__

Method __init__

python_server/classifier.py:28–43  ·  view source on GitHub ↗
(self, CNN_name, dataset, dropout=False)

Source from the content-addressed store, hash-verified

26}
27class CNN(nn.Module):
28 def __init__(self, CNN_name, dataset, dropout=False):
29 super(CNN, self).__init__()
30 self.dataset = dataset
31 self.query_num = 0
32 self.features = self._make_layers(mycfg[CNN_name])
33 if dropout:
34 self.classifier = nn.Sequential(
35 nn.Dropout(0.6),
36 nn.Linear(512, 256),
37 nn.ReLU(True),
38 nn.Linear(256, parameters[self.dataset][1]) )
39 else:
40 self.classifier = nn.Sequential(
41 nn.Linear(512, 256),
42 nn.ReLU(True),
43 nn.Linear(256, parameters[self.dataset][1]) )
44
45 def forward(self, x):
46 self.query_num += 1

Callers 1

__init__Method · 0.45

Calls 1

_make_layersMethod · 0.95

Tested by

no test coverage detected