MCPcopy Create free account
hub / github.com/Meshcapade/difflocks / LinearWN_v2

Class LinearWN_v2

modules/networks.py:54–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52
53
54class LinearWN_v2(torch.nn.Linear):
55 def __init__(self, in_features, out_features, bias=True):
56 super(LinearWN_v2, self).__init__(in_features, out_features, bias)
57 self.g = torch.nn.Parameter(torch.ones(out_features))
58
59
60 self.in_features=in_features
61 self.out_features=out_features
62
63 def forward(self, input):
64 w= torch._weight_norm(self.weight, self.g, 0)
65 out=F.linear(input, w, self.bias)
66 return out
67
68
69

Callers 2

__init__Method · 0.90
__init__Method · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected