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

Class NeuralNetwork

beginner_source/basics/optimization_tutorial.py:50–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48test_dataloader = DataLoader(test_data, batch_size=64)
49
50class NeuralNetwork(nn.Module):
51 def __init__(self):
52 super().__init__()
53 self.flatten = nn.Flatten()
54 self.linear_relu_stack = nn.Sequential(
55 nn.Linear(28*28, 512),
56 nn.ReLU(),
57 nn.Linear(512, 512),
58 nn.ReLU(),
59 nn.Linear(512, 10),
60 )
61
62 def forward(self, x):
63 x = self.flatten(x)
64 logits = self.linear_relu_stack(x)
65 return logits
66
67model = NeuralNetwork()
68

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected