Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,21 +38,21 @@ class EEG_CNN(nn.Module):
|
|
| 38 |
def __init__(self, input_dim, output_dim):
|
| 39 |
super().__init__()
|
| 40 |
|
| 41 |
-
self.conv1 = nn.Conv1d(1,
|
| 42 |
-
self.bn1 = nn.BatchNorm1d(
|
| 43 |
|
| 44 |
-
self.conv2 = nn.Conv1d(
|
| 45 |
-
self.bn2 = nn.BatchNorm1d(
|
| 46 |
|
| 47 |
-
self.conv3 = nn.Conv1d(
|
| 48 |
-
self.bn3 = nn.BatchNorm1d(
|
| 49 |
|
| 50 |
self.pool = nn.AdaptiveAvgPool1d(1)
|
| 51 |
|
| 52 |
-
self.fc = nn.Linear(
|
| 53 |
|
| 54 |
def forward(self, x):
|
| 55 |
-
x = x.unsqueeze(1)
|
| 56 |
|
| 57 |
x = torch.relu(self.bn1(self.conv1(x)))
|
| 58 |
x = torch.relu(self.bn2(self.conv2(x)))
|
|
|
|
| 38 |
def __init__(self, input_dim, output_dim):
|
| 39 |
super().__init__()
|
| 40 |
|
| 41 |
+
self.conv1 = nn.Conv1d(1, 32, kernel_size=7, padding=3)
|
| 42 |
+
self.bn1 = nn.BatchNorm1d(32)
|
| 43 |
|
| 44 |
+
self.conv2 = nn.Conv1d(32, 64, kernel_size=5, padding=2)
|
| 45 |
+
self.bn2 = nn.BatchNorm1d(64)
|
| 46 |
|
| 47 |
+
self.conv3 = nn.Conv1d(64, 128, kernel_size=3, padding=1)
|
| 48 |
+
self.bn3 = nn.BatchNorm1d(128)
|
| 49 |
|
| 50 |
self.pool = nn.AdaptiveAvgPool1d(1)
|
| 51 |
|
| 52 |
+
self.fc = nn.Linear(128, output_dim)
|
| 53 |
|
| 54 |
def forward(self, x):
|
| 55 |
+
x = x.unsqueeze(1)
|
| 56 |
|
| 57 |
x = torch.relu(self.bn1(self.conv1(x)))
|
| 58 |
x = torch.relu(self.bn2(self.conv2(x)))
|