Skip to content

Commit 65fedd8

Browse files
committed
updated documentation for JohanModel
1 parent a56e224 commit 65fedd8

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

CollaborativeCoding/models/johan_model.py

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,32 @@
44
Multi-layer perceptron model for image classification.
55
"""
66

7-
# class NeuronLayer(nn.Module):
8-
# def __init__(self, in_features, out_features):
9-
# super().__init__()
10-
11-
# self.fc = nn.Linear(in_features, out_features)
12-
# self.relu = nn.ReLU()
13-
14-
# def forward(self, x):
15-
# x = self.fc(x)
16-
# x = self.relu(x)
17-
# return x
18-
197

208
class JohanModel(nn.Module):
219
"""Small MLP model for image classification.
2210
2311
Parameters
2412
----------
25-
in_features : int
26-
Numer of input features.
13+
image_shape : tuple(int, int, int)
14+
Shape of the input image (C, H, W).
2715
num_classes : int
2816
Number of classes in the dataset.
17+
18+
Processing Images
19+
-----------------
20+
Input: (N, C, H, W)
21+
N: Batch size
22+
C: Number of input channels
23+
H: Height of the input image
24+
W: Width of the input image
25+
26+
Example:
27+
Grayscale images (like MNIST) have C = 1.
28+
Input shape: (N, 1, 28, 28)
29+
fc1 Output shape: (N, 77)
30+
fc2 Output shape: (N, 77)
31+
fc3 Output shape: (N, 77)
32+
fc4 Output shape: (N, num_classes)
2933
"""
3034

3135
def __init__(self, image_shape, num_classes):

0 commit comments

Comments
 (0)