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

Method __init__

mnist_forward_forward/main.py:60–65  ·  view source on GitHub ↗
(self, in_features, out_features, bias=True, device=None, dtype=None)

Source from the content-addressed store, hash-verified

58
59class Layer(nn.Linear):
60 def __init__(self, in_features, out_features, bias=True, device=None, dtype=None):
61 super().__init__(in_features, out_features, bias, device, dtype)
62 self.relu = torch.nn.ReLU()
63 self.opt = Adam(self.parameters(), lr=args.lr)
64 self.threshold = args.threshold
65 self.num_epochs = args.epochs
66
67 def forward(self, x):
68 x_direction = x / (x.norm(2, 1, keepdim=True) + 1e-4)

Callers

nothing calls this directly

Calls 1

__init__Method · 0.45

Tested by

no test coverage detected