Spaces:
Runtime error
Runtime error
Update TumorModel.py
Browse files- TumorModel.py +3 -16
TumorModel.py
CHANGED
|
@@ -16,7 +16,9 @@ class TumorClassification(nn.Module):
|
|
| 16 |
self.pool3 = nn.MaxPool2d(2)
|
| 17 |
|
| 18 |
self.flatten = nn.Flatten()
|
| 19 |
-
|
|
|
|
|
|
|
| 20 |
self.relu_fc = nn.ReLU()
|
| 21 |
self.fc2 = nn.Linear(512, 256)
|
| 22 |
self.relu_fc2 = nn.ReLU()
|
|
@@ -31,18 +33,3 @@ class TumorClassification(nn.Module):
|
|
| 31 |
x = self.relu_fc2(self.fc2(x))
|
| 32 |
x = self.output(x)
|
| 33 |
return x
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
class GliomaStageModel(nn.Module):
|
| 37 |
-
def __init__(self):
|
| 38 |
-
super(GliomaStageModel, self).__init__()
|
| 39 |
-
self.model = nn.Sequential(
|
| 40 |
-
nn.Linear(9, 128),
|
| 41 |
-
nn.ReLU(),
|
| 42 |
-
nn.Linear(128, 64),
|
| 43 |
-
nn.ReLU(),
|
| 44 |
-
nn.Linear(64, 4)
|
| 45 |
-
)
|
| 46 |
-
|
| 47 |
-
def forward(self, x):
|
| 48 |
-
return self.model(x)
|
|
|
|
| 16 |
self.pool3 = nn.MaxPool2d(2)
|
| 17 |
|
| 18 |
self.flatten = nn.Flatten()
|
| 19 |
+
|
| 20 |
+
# 👇 Update this line to match the saved .pth model
|
| 21 |
+
self.fc1 = nn.Linear(86528, 512) # Fixed input size
|
| 22 |
self.relu_fc = nn.ReLU()
|
| 23 |
self.fc2 = nn.Linear(512, 256)
|
| 24 |
self.relu_fc2 = nn.ReLU()
|
|
|
|
| 33 |
x = self.relu_fc2(self.fc2(x))
|
| 34 |
x = self.output(x)
|
| 35 |
return x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|