qumphy.models.dumbnet module

File: qumphy/models/dumbnet.py Project: 22HLT01 QUMPHY Contact: oskar.pfeffer@ptb.de Gitlab: https://gitlab.com/qumphy Description: TinyVGG-style convolutional neural network.

class qumphy.models.dumbnet.DumbNet(input_shape, hidden_units, output_shape)[source]

Bases: Module

Model architecture that replicates the TinyVGG model from CNN explainer website.

Parameters:
  • input_shape (int) – Number of input channels.

  • hidden_units (int) – Number of hidden channels used in the convolutional layers.

  • output_shape (int) – Number of output classes or output values.

forward(x)[source]

Run a forward pass through the model.

Parameters:

x (torch.Tensor) – Input tensor of shape (batch_size, input_shape, height, width).

Returns:

Model output tensor of shape (batch_size, output_shape).

Return type:

torch.Tensor