Spaces:
Sleeping
Sleeping
Download src/classifer.py from Ephab/Hand_Digit_Recognition: direct link, hf CLI and curl.
- Browser
- Download file 654 Bytes
-
https://huggingface.co/spaces/Ephab/Hand_Digit_Recognition/resolve/main/src/classifer.py
- Command line
-
hf download hf://spaces/Ephab/Hand_Digit_Recognition/src/classifer.py
-
curl -L -o classifer.py https://huggingface.co/spaces/Ephab/Hand_Digit_Recognition/resolve/main/src/classifer.py
654 Bytes
| import torch | |
| import torch.nn as nn | |
| class Classifier(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| self.feedforward = nn.Sequential( | |
| nn.BatchNorm1d(63), | |
| nn.Linear(in_features=63, out_features=256), | |
| nn.ReLU(), | |
| nn.Dropout(0.3), | |
| nn.BatchNorm1d(256), | |
| nn.Linear(in_features=256, out_features=128), | |
| nn.ReLU(), | |
| nn.Dropout(0.3), | |
| nn.BatchNorm1d(128), | |
| nn.Linear(in_features=128, out_features=5), | |
| ) | |
| def forward(self, x): | |
| x = self.feedforward(x) | |
| return x |