Spaces:
Sleeping
Sleeping
Download model/model.py from nutripath/nutripath-ml: direct link, hf CLI and curl.
- Browser
- Download file 530 Bytes
-
https://huggingface.co/spaces/nutripath/nutripath-ml/resolve/main/model/model.py
- Command line
-
hf download hf://spaces/nutripath/nutripath-ml/model/model.py
-
curl -L -o model.py https://huggingface.co/spaces/nutripath/nutripath-ml/resolve/main/model/model.py
530 Bytes
| import torch | |
| import torch.nn as nn | |
| class FoodMLP(nn.Module): | |
| def __init__(self, input_size, num_classes=3): | |
| super(FoodMLP, self).__init__() | |
| self.layers = nn.Sequential( | |
| nn.Linear(input_size, 128), | |
| nn.ReLU(), | |
| nn.Dropout(0.3), | |
| nn.Linear(128, 64), | |
| nn.ReLU(), | |
| nn.Dropout(0.3), | |
| nn.Linear(64, 32), | |
| nn.ReLU(), | |
| nn.Linear(32, num_classes) | |
| ) | |
| def forward(self, x): | |
| return self.layers(x) |