-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbaseline.py
30 lines (24 loc) · 999 Bytes
/
baseline.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import torch.nn as nn
from .utils import init_weights
class BaseLineModel(nn.Module):
def __init__(self, input_nodes=98):
super().__init__()
self.fcnn = nn.Sequential(
nn.Linear(input_nodes, 8*input_nodes),
nn.BatchNorm1d(8*input_nodes),
nn.ReLU(),
nn.Linear(8*input_nodes, 4*input_nodes),
nn.BatchNorm1d(4*input_nodes),
nn.ReLU(),
nn.Linear(4*input_nodes, 2*input_nodes),
nn.BatchNorm1d(2*input_nodes),
nn.ReLU(),
nn.Linear(2*input_nodes, input_nodes),
nn.BatchNorm1d(input_nodes),
nn.ReLU(),
nn.Linear(input_nodes, input_nodes-3),
)
self.fcnn.apply(init_weights)
def forward(self, x):
x = self.fcnn(x)
return x