Spaces:
Build error
Build error
Download NeuralNet.py from nullHawk/digit_recognition_ffnn: direct link, hf CLI and curl.
- Browser
- Download file 434 Bytes
-
https://huggingface.co/spaces/nullHawk/digit_recognition_ffnn/resolve/main/NeuralNet.py
- Command line
-
hf download hf://spaces/nullHawk/digit_recognition_ffnn/NeuralNet.py
-
curl -L -o NeuralNet.py https://huggingface.co/spaces/nullHawk/digit_recognition_ffnn/resolve/main/NeuralNet.py
434 Bytes
| import torch | |
| import torch.nn as nn | |
| class NeuralNet(nn.Module): | |
| def __init__(self, input_size, hidden_size, num_classes): | |
| super(NeuralNet, self).__init__() | |
| self.l1 = nn.Linear(input_size, hidden_size) | |
| self.relu = nn.ReLU() | |
| self.l2 = nn.Linear(hidden_size, num_classes) | |
| def forward(self, x): | |
| out = self.l1(x) | |
| out = self.relu(out) | |
| out = self.l2(out) | |
| return out |