MCPcopy Create free account
hub / github.com/pytorch/examples / init_weights

Method init_weights

siamese_network/main.py:54–57  ·  view source on GitHub ↗
(self, m)

Source from the content-addressed store, hash-verified

52 self.fc.apply(self.init_weights)
53
54 def init_weights(self, m):
55 if isinstance(m, nn.Linear):
56 torch.nn.init.xavier_uniform_(m.weight)
57 m.bias.data.fill_(0.01)
58
59 def forward_once(self, x):
60 output = self.resnet(x)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected