Skip to content

Commit 084dee2

Browse files
committed
All tests are fixed!
1 parent a1acf07 commit 084dee2

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

CollaborativeCoding/dataloaders/download.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ def download_svhn(path, train: bool = True):
9898
train_data = parent_path / "train_32x32.mat"
9999
test_data = parent_path / "test_32x32.mat"
100100

101-
if not train_data.exists():
101+
if not train_data.is_file():
102102
download_svhn(parent_path, train=True)
103-
if not test_data.exists():
103+
if not test_data.is_file():
104104
download_svhn(parent_path, train=False)
105-
105+
print(test_data)
106106
train_labels = loadmat(train_data)["y"]
107107
test_labels = loadmat(test_data)["y"]
108108

CollaborativeCoding/models/magnus_model.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33

44
class MagnusModel(nn.Module):
5-
def __init__(self, image_shape, num_classes: int, nr_channels: int = 1):
5+
def __init__(self, image_shape, num_classes: int):
66
"""
77
Initializes the MagnusModel, a neural network designed for image classification tasks.
88
The model consists of three linear layers, each with 133 neurons, and uses ReLU activation
@@ -14,11 +14,11 @@ def __init__(self, image_shape, num_classes: int, nr_channels: int = 1):
1414
nr_channels (int): The number of channels in the input image.
1515
"""
1616
super().__init__()
17-
*_, H, W = image_shape
17+
C, H, W = image_shape[-3], image_shape[-2], image_shape[-1]
1818
self.layer1 = nn.Sequential(
1919
*(
2020
[
21-
nn.Linear(nr_channels * H * W, 133),
21+
nn.Linear(C * H * W, 133),
2222
nn.ReLU(),
2323
]
2424
)

0 commit comments

Comments
 (0)