Upload model.py with huggingface_hub
Browse files
model.py
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import torch.nn as nn
|
| 2 |
+
|
| 3 |
+
# ckp_02
|
| 4 |
+
class MajorClassifier(nn.Module):
|
| 5 |
+
def __init__(self, input_size=768, output_size=9):
|
| 6 |
+
super(MajorClassifier, self).__init__()
|
| 7 |
+
self.model = nn.Sequential(
|
| 8 |
+
nn.Linear(input_size, 512),
|
| 9 |
+
nn.ReLU(),
|
| 10 |
+
nn.Linear(512, 512),
|
| 11 |
+
nn.ReLU(),
|
| 12 |
+
nn.Linear(512, 256),
|
| 13 |
+
nn.ReLU(),
|
| 14 |
+
nn.Linear(256, 128),
|
| 15 |
+
nn.ReLU(),
|
| 16 |
+
nn.Linear(128, 64),
|
| 17 |
+
nn.ReLU(),
|
| 18 |
+
nn.Linear(64, output_size),
|
| 19 |
+
)
|
| 20 |
+
|
| 21 |
+
def forward(self, x):
|
| 22 |
+
return self.model(x)
|
| 23 |
+
|
| 24 |
+
# class MajorClassifier(nn.Module):
|
| 25 |
+
# def __init__(self, input_size=768, output_size=9, dropout_prob=0.1):
|
| 26 |
+
# super(MajorClassifier, self).__init__()
|
| 27 |
+
# self.model = nn.Sequential(
|
| 28 |
+
# nn.Linear(input_size, 512),
|
| 29 |
+
# nn.BatchNorm1d(512),
|
| 30 |
+
# nn.ReLU(),
|
| 31 |
+
# nn.Dropout(dropout_prob),
|
| 32 |
+
# nn.Linear(512, 512),
|
| 33 |
+
# nn.BatchNorm1d(512),
|
| 34 |
+
# nn.ReLU(),
|
| 35 |
+
# nn.Dropout(dropout_prob),
|
| 36 |
+
# nn.Linear(512, 256),
|
| 37 |
+
# nn.BatchNorm1d(256),
|
| 38 |
+
# nn.ReLU(),
|
| 39 |
+
# nn.Dropout(dropout_prob),
|
| 40 |
+
# nn.Linear(256, 256),
|
| 41 |
+
# nn.BatchNorm1d(256),
|
| 42 |
+
# nn.ReLU(),
|
| 43 |
+
# nn.Dropout(dropout_prob),
|
| 44 |
+
# nn.Linear(256, 128),
|
| 45 |
+
# nn.BatchNorm1d(128),
|
| 46 |
+
# nn.ReLU(),
|
| 47 |
+
# nn.Dropout(dropout_prob),
|
| 48 |
+
# nn.Linear(128, 128),
|
| 49 |
+
# nn.BatchNorm1d(128),
|
| 50 |
+
# nn.ReLU(),
|
| 51 |
+
# nn.Dropout(dropout_prob),
|
| 52 |
+
# nn.Linear(128, 64),
|
| 53 |
+
# nn.BatchNorm1d(64),
|
| 54 |
+
# nn.ReLU(),
|
| 55 |
+
# nn.Dropout(dropout_prob),
|
| 56 |
+
# nn.Linear(64, 64),
|
| 57 |
+
# nn.BatchNorm1d(64),
|
| 58 |
+
# nn.ReLU(),
|
| 59 |
+
# nn.Dropout(dropout_prob),
|
| 60 |
+
# nn.Linear(64, output_size),
|
| 61 |
+
# )
|
| 62 |
+
|
| 63 |
+
# def forward(self, x):
|
| 64 |
+
# return self.model(x)
|