Spaces:
Runtime error
Runtime error
Download models from StarParty1972/asadadsadasd: direct link, hf CLI and curl.
- Browser
- Download file 661 Bytes
-
https://huggingface.co/spaces/StarParty1972/asadadsadasd/resolve/main/models
- Command line
-
hf download hf://spaces/StarParty1972/asadadsadasd/models
-
curl -L -o models https://huggingface.co/spaces/StarParty1972/asadadsadasd/resolve/main/models
661 Bytes
| import torch | |
| import torch.nn as nn | |
| class MNISTCNN(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| self.features = nn.Sequential( | |
| nn.Conv2d(1, 32, kernel_size=3), | |
| nn.ReLU(), | |
| nn.MaxPool2d(2), | |
| nn.Conv2d(32, 64, kernel_size=3), | |
| nn.ReLU(), | |
| nn.MaxPool2d(2) | |
| ) | |
| self.classifier = nn.Sequential( | |
| nn.Flatten(), | |
| nn.Linear(64 * 5 * 5, 128), | |
| nn.ReLU(), | |
| nn.Linear(128, 10) | |
| ) | |
| def forward(self, x: torch.Tensor) -> torch.Tensor: | |
| x = self.features(x) | |
| x = self.classifier(x) | |
| return x |