Download MLmodel.py from Pratham0712/NP: direct link, hf CLI and curl.
- Browser
- Download file 569 Bytes
-
https://huggingface.co/Pratham0712/NP/resolve/main/MLmodel.py
- Command line
-
hf download hf://Pratham0712/NP/MLmodel.py
-
curl -L -o MLmodel.py https://huggingface.co/Pratham0712/NP/resolve/main/MLmodel.py
569 Bytes
| import torch | |
| import torch.nn as nn | |
| class MLmodel(nn.Module): | |
| def __init__(self, input_dim): | |
| super(MLmodel, self).__init__() | |
| self.fc1 = nn.Linear(input_dim, 128) | |
| self.bn1 = nn.BatchNorm1d(128) | |
| self.fc2 = nn.Linear(128, 64) | |
| self.bn2 = nn.BatchNorm1d(64) | |
| self.fc3 = nn.Linear(64, 2) | |
| self.relu = nn.ReLU() | |
| self.sm = nn.Softmax(dim = 1) | |
| def forward(self, x): | |
| x = self.relu(self.bn1(self.fc1(x))) | |
| x = self.relu(self.bn2(self.fc2(x))) | |
| x = self.sm(self.fc3(x)) | |
| return x |