CollaborativeCoding.models.johan_model

Classes

JohanModel

Small MLP model for image classification.

Module Contents

class CollaborativeCoding.models.johan_model.JohanModel(image_shape, num_classes)

Bases: torch.nn.Module

Small MLP model for image classification.

Parameters

image_shapetuple(int, int, int)

Shape of the input image (C, H, W).

num_classesint

Number of classes in the dataset.

Processing Images

Input: (N, C, H, W)

N: Batch size C: Number of input channels H: Height of the input image W: Width of the input image

Example: Grayscale images (like MNIST) have C = 1. Input shape: (N, 1, 28, 28) fc1 Output shape: (N, 77) fc2 Output shape: (N, 77) fc3 Output shape: (N, 77) fc4 Output shape: (N, num_classes)

in_channels
height
width
num_classes
in_features
fc1
fc2
fc3
fc4
relu
flatten
forward(x)