Perceptron#

class capymoa.ann.Perceptron[source]#

Bases: Module

A simple feedforward neural network with one hidden layer.

__init__(schema: Schema, hidden_size: int = 50)[source]#

Initialize the model.

Parameters:
  • schema – Schema describing the data types and shapes.

  • hidden_size – Number of hidden units in the first layer.

forward(x: Tensor) Tensor[source]#

Forward pass through the network.

Parameters:

x – Input tensor of shape (batch_size, num_features).

Returns:

Output tensor of shape (batch_size, num_classes).