Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions CollaborativeCoding/dataloaders/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,11 @@ def download_svhn(path, train: bool = True):
train_data = parent_path / "train_32x32.mat"
test_data = parent_path / "test_32x32.mat"

if not train_data.exists():
if not train_data.is_file():
download_svhn(parent_path, train=True)
if not test_data.exists():
if not test_data.is_file():
download_svhn(parent_path, train=False)

print(test_data)
train_labels = loadmat(train_data)["y"]
test_labels = loadmat(test_data)["y"]

Expand Down
6 changes: 3 additions & 3 deletions CollaborativeCoding/models/magnus_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class MagnusModel(nn.Module):
def __init__(self, image_shape, num_classes: int, nr_channels: int = 1):
def __init__(self, image_shape, num_classes: int):
"""
Initializes the MagnusModel, a neural network designed for image classification tasks.
The model consists of three linear layers, each with 133 neurons, and uses ReLU activation
Expand All @@ -14,11 +14,11 @@ def __init__(self, image_shape, num_classes: int, nr_channels: int = 1):
nr_channels (int): The number of channels in the input image.
"""
super().__init__()
*_, H, W = image_shape
C, H, W = image_shape[-3], image_shape[-2], image_shape[-1]
self.layer1 = nn.Sequential(
*(
[
nn.Linear(nr_channels * H * W, 133),
nn.Linear(C * H * W, 133),
nn.ReLU(),
]
)
Expand Down