MorphKnight1440 commited on
Commit
e277217
·
verified ·
1 Parent(s): 9ead134

Upload model.py with huggingface_hub

Browse files
Files changed (1) hide show
  1. model.py +29 -0
model.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import torch
2
+ import torch.nn as nn
3
+
4
+ class TremorCNN(nn.Module):
5
+ def __init__(self):
6
+ super().__init__()
7
+ self.conv = nn.Sequential(
8
+ nn.Conv2d(1, 16, kernel_size=3, padding=1),
9
+ nn.ReLU(),
10
+ nn.MaxPool2d(2),
11
+
12
+ nn.Conv2d(16, 32, kernel_size=3, padding=1),
13
+ nn.ReLU(),
14
+ nn.MaxPool2d(2),
15
+ )
16
+
17
+ self.fc = nn.Sequential(
18
+ nn.Dropout(0.5),
19
+ nn.Linear(704, 64),
20
+ nn.ReLU(),
21
+ nn.Dropout(0.3),
22
+ nn.Linear(64, 1),
23
+ )
24
+
25
+ def forward(self, x):
26
+ x = self.conv(x)
27
+ x = x.view(x.size(0), -1)
28
+ x = self.fc(x)
29
+ return x