Download model.py from x2bee/Major_Category_Classfifier: direct link, hf CLI and curl.
- Browser
- Download file 2.06 kB
-
https://huggingface.co/x2bee/Major_Category_Classfifier/resolve/main/model.py
- Command line
-
hf download hf://x2bee/Major_Category_Classfifier/model.py
-
curl -L -o model.py https://huggingface.co/x2bee/Major_Category_Classfifier/resolve/main/model.py
2.06 kB
| import torch.nn as nn | |
| # ckp_02 | |
| class MajorClassifier(nn.Module): | |
| def __init__(self, input_size=768, output_size=9): | |
| super(MajorClassifier, self).__init__() | |
| self.model = nn.Sequential( | |
| nn.Linear(input_size, 512), | |
| nn.ReLU(), | |
| nn.Linear(512, 512), | |
| nn.ReLU(), | |
| nn.Linear(512, 256), | |
| nn.ReLU(), | |
| nn.Linear(256, 128), | |
| nn.ReLU(), | |
| nn.Linear(128, 64), | |
| nn.ReLU(), | |
| nn.Linear(64, output_size), | |
| ) | |
| def forward(self, x): | |
| return self.model(x) | |
| # class MajorClassifier(nn.Module): | |
| # def __init__(self, input_size=768, output_size=9, dropout_prob=0.1): | |
| # super(MajorClassifier, self).__init__() | |
| # self.model = nn.Sequential( | |
| # nn.Linear(input_size, 512), | |
| # nn.BatchNorm1d(512), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(512, 512), | |
| # nn.BatchNorm1d(512), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(512, 256), | |
| # nn.BatchNorm1d(256), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(256, 256), | |
| # nn.BatchNorm1d(256), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(256, 128), | |
| # nn.BatchNorm1d(128), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(128, 128), | |
| # nn.BatchNorm1d(128), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(128, 64), | |
| # nn.BatchNorm1d(64), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(64, 64), | |
| # nn.BatchNorm1d(64), | |
| # nn.ReLU(), | |
| # nn.Dropout(dropout_prob), | |
| # nn.Linear(64, output_size), | |
| # ) | |
| # def forward(self, x): | |
| # return self.model(x) |