MCPcopy Create free account
hub / github.com/LetheSec/PLG-MI-Attack / __init__

Method __init__

models/classifiers/classifier.py:39–47  ·  view source on GitHub ↗
(self, n_classes)

Source from the content-addressed store, hash-verified

37
38class VGG16(nn.Module):
39 def __init__(self, n_classes):
40 super(VGG16, self).__init__()
41 model = torchvision.models.vgg16_bn(pretrained=True)
42 self.feature = model.features
43 self.feat_dim = 512 * 2 * 2
44 self.n_classes = n_classes
45 self.bn = nn.BatchNorm1d(self.feat_dim)
46 self.bn.bias.requires_grad_(False) # no shift
47 self.fc_layer = nn.Linear(self.feat_dim, self.n_classes)
48
49 def forward(self, x):
50 feature = self.feature(x)

Callers 6

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

Calls

no outgoing calls

Tested by

no test coverage detected