CollaborativeCoding.models.jan_model

Attributes

model

Classes

JanModel

A simple MLP network model for image classification tasks. Two hidden layers with 100 neurons.

Module Contents

class CollaborativeCoding.models.jan_model.JanModel(image_shape, num_classes)

Bases: torch.nn.Module

A simple MLP network model for image classification tasks. Two hidden layers with 100 neurons.

Args

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: For grayscale images, C = 1.

Input Image Shape: (5, 1, 28, 28) flatten Output Shape: (5, 784) fc1 Output Shape: (5, 100) fc2 Output Shape: (5, 100) out Output Shape: (5, num_classes)

in_channels
height
width
num_classes
fc1
fc2
out
leaky_relu
flatten
forward(x)
CollaborativeCoding.models.jan_model.model