MCPcopy Index your code
hub / github.com/pytorch/tutorials / Mnist_Logistic

Class Mnist_Logistic

beginner_source/nn_tutorial.py:304–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

302from torch import nn
303
304class Mnist_Logistic(nn.Module):
305 def __init__(self):
306 super().__init__()
307 self.weights = nn.Parameter(torch.randn(784, 10) / math.sqrt(784))
308 self.bias = nn.Parameter(torch.zeros(10))
309
310 def forward(self, xb):
311 return xb @ self.weights + self.bias
312
313###############################################################################
314# Since we're now using an object instead of just using a function, we

Callers 2

nn_tutorial.pyFile · 0.85
get_modelFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected