-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodel.py
37 lines (30 loc) · 936 Bytes
/
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
import torch
class CNN(torch.nn.Module):
"""
Yes
"""
def __init__(self):
super(CNN, self).__init__()
self.lin1 = torch.nn.Linear(90*90, 90*90)
self.ac1 = torch.nn.ReLU()
self.lin2 = torch.nn.Linear(90*90, 90*90)
self.ac2 = torch.nn.ReLU()
self.lin3 = torch.nn.Linear(90*90, 90*90)
self.ac3 = torch.nn.ReLU()
self.lin4 = torch.nn.Linear(90*90, 90*90)
self.ac4 = torch.nn.ReLU()
self.lin5 = torch.nn.Linear(90*90, 90*90)
self.ac5 = torch.nn.ReLU()
self.lin6 = torch.nn.Linear(90*90, 90*90)
def forward(self, x: torch.Tensor) -> torch.Tensor:
x = self.lin1(x)
x = self.ac1(x)
x = self.lin2(x)
x = self.ac2(x)
x = self.lin3(x)
x = self.ac3(x)
x = self.lin4(x)
x = self.ac4(x)
x = self.lin5(x)
x = self.ac5(x)
return self.lin6(x)