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.
def
TorchLean.nn.models.mlpRelu
(cfg : MlpConfig)
:
M (Sequential (mlpInShape cfg) (mlpOutShape cfg))
Build a single-hidden-layer MLP with relu activation:
linear(inDim → hidDim) → relu → linear(hidDim → outDim).