MCPcopy Create free account
hub / github.com/Sirwenhao/Deep-Learning-Notes / __init__

Method __init__

CV/Pytorch_classification/VGGNet/model.py:17–30  ·  view source on GitHub ↗
(self, features, num_classes=1000, init_weights=False)

Source from the content-addressed store, hash-verified

15
16class VGG(nn.Module):
17 def __init__(self, features, num_classes=1000, init_weights=False):
18 super(VGG, self).__init__()
19 self.features = features
20 self.classifier = nn.Sequential(
21 nn.Linear(512*7*7, 4096),
22 nn.ReLU(True),
23 nn.Dropout(p=0.5),
24 nn.Linear(4096, 4096),
25 nn.ReLU(True),
26 nn.Dropout(p=0.5),
27 nn.Linear(4096, num_classes)
28 )
29 if init_weights:
30 self._initialize_weights()
31
32 def forward(self, x):
33 # N x 3 x 224 x 224

Callers

nothing calls this directly

Calls 1

_initialize_weightsMethod · 0.95

Tested by

no test coverage detected