-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.py
43 lines (33 loc) · 1.12 KB
/
model.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
31
32
33
34
35
36
37
38
39
40
41
42
43
import torch
import torch.nn as nn
class loan_classify(nn.Module) :
def __init__(self):
super(loan_classify, self).__init__()
self.fc1 = nn.Linear(9, 128)
self.batch_norm1 = nn.BatchNorm1d(128)
self.relu1 = nn.ReLU()
self.dropout1 = nn.Dropout(0.5)
self.fc2 = nn.Linear(128, 64)
self.batch_norm2 = nn.BatchNorm1d(64)
self.relu2 = nn.ReLU()
self.dropout2 = nn.Dropout(0.1)
self.fc3 = nn.Linear(64, 32)
self.batch_norm3 = nn.BatchNorm1d(32)
self.relu3 = nn.ReLU()
self.fc4 = nn.Linear(32, 1)
self.sigmoid = nn.Sigmoid()
def forward(self, x):
out = self.fc1(x)
out = self.batch_norm1(out)
out = self.relu1(out)
out = self.dropout1(out)
out = self.fc2(out)
out = self.batch_norm2(out)
out = self.relu2(out)
out = self.dropout2(out)
out = self.fc3(out)
out = self.batch_norm3(out)
out = self.relu3(out)
out = self.fc4(out)
out = self.sigmoid(out)
return out