TorchLean API

NN.API.Models.Mlp

Multilayer Perceptrons #

Compact, reusable MLP-shaped model constructors for TorchLean examples.

These live in the API layer so runnable examples can stay focused on: data loading, training loops, and CLI flags, rather than repeating the same linear → activation → linear boilerplate.

Scope note: these are building blocks, not pretrained checkpoints.

Configuration for a single-hidden-layer MLP over batched row vectors.

Instances For
    @[reducible, inline]

    Input shape (batch × inDim) for an MlpConfig.

    Instances For
      @[reducible, inline]

      Output shape (batch × outDim) for an MlpConfig.

      Instances For

        Build a single-hidden-layer MLP with relu activation:

        linear(inDim → hidDim) → relu → linear(hidDim → outDim).

        Instances For