torchcell.models.mlp.Mlp

class Mlp(in_channels: int, hidden_channels: int, out_channels: int, num_layers: int, dropout_prob: float = 0.0, norm: str | None = None, activation: str | None = None, output_activation: str | None = None)[source]

Bases: Module

Sequential MLP built from linear blocks with optional norm and activation.

forward(x: Tensor) → Tensor[source]

Run the input through the MLP and squeeze the trailing dimension.