TorchLean API

NN.API.Models.Mlp

MLP Model Helpers (API) #

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 Mlp1Config.

    Instances For
      @[reducible, inline]

      Output shape (batch × outDim) for an Mlp1Config.

      Instances For

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

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

        Instances For