Download model.py from MorphKnight1440/TremorCNN: direct link, hf CLI and curl.
- Browser
- Download file 718 Bytes
-
https://huggingface.co/MorphKnight1440/TremorCNN/resolve/main/model.py
- Command line
-
hf download hf://MorphKnight1440/TremorCNN/model.py
-
curl -L -o model.py https://huggingface.co/MorphKnight1440/TremorCNN/resolve/main/model.py
718 Bytes
| import torch | |
| import torch.nn as nn | |
| class TremorCNN(nn.Module): | |
| def __init__(self): | |
| super().__init__() | |
| self.conv = nn.Sequential( | |
| nn.Conv2d(1, 16, kernel_size=3, padding=1), | |
| nn.ReLU(), | |
| nn.MaxPool2d(2), | |
| nn.Conv2d(16, 32, kernel_size=3, padding=1), | |
| nn.ReLU(), | |
| nn.MaxPool2d(2), | |
| ) | |
| self.fc = nn.Sequential( | |
| nn.Dropout(0.5), | |
| nn.Linear(704, 64), | |
| nn.ReLU(), | |
| nn.Dropout(0.3), | |
| nn.Linear(64, 1), | |
| ) | |
| def forward(self, x): | |
| x = self.conv(x) | |
| x = x.view(x.size(0), -1) | |
| x = self.fc(x) | |
| return x |