Download model.py from ByteJoseph/realtime-digit-draw: direct link, hf CLI and curl.
- Browser
- Download file 509 Bytes
-
https://huggingface.co/ByteJoseph/realtime-digit-draw/resolve/main/model.py
- Command line
-
hf download hf://ByteJoseph/realtime-digit-draw/model.py
-
curl -L -o model.py https://huggingface.co/ByteJoseph/realtime-digit-draw/resolve/main/model.py
509 Bytes
| import torch.nn as nn | |
| class ANN(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| self.fc1 = nn.Linear(28*28,128) | |
| self.fc2 = nn.Linear(128,128) | |
| self.fc3 = nn.Linear(128,128) | |
| self.fc4 = nn.Linear(128,10) | |
| self.relu = nn.ReLU() | |
| def forward(self,x): | |
| x = x.view(-1,28*28) | |
| x = self.relu(self.fc1(x)) | |
| x = self.relu(self.fc2(x)) | |
| x = self.relu(self.fc3(x)) | |
| x = self.relu(self.fc4(x)) | |
| return x | |