Skip to content

Commit

Permalink
Update model to input image_shape rather than in_channels
Browse files Browse the repository at this point in the history
  • Loading branch information
salomaestro committed Feb 4, 2025
1 parent 9ad01e4 commit f4e5591
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions utils/models/christian_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ class ChristianModel(nn.Module):
Args
----
in_channels : int
Number of input channels.
image_shape : tuple(int, int, int)
Shape of the input image (C, H, W).
num_classes : int
Number of classes in the dataset.
Expand All @@ -49,10 +49,12 @@ class ChristianModel(nn.Module):
FC Output Shape: (5, num_classes)
"""

def __init__(self, in_channels, num_classes):
def __init__(self, image_shape, num_classes):
super().__init__()

self.cnn1 = CNNBlock(in_channels, 50)
C, *_ = image_shape

self.cnn1 = CNNBlock(C, 50)
self.cnn2 = CNNBlock(50, 100)

self.fc1 = nn.Linear(100 * 4 * 4, num_classes)
Expand Down

0 comments on commit f4e5591

Please sign in to comment.