TorchLean API

NN.Examples.Models.Supervised.Mlp

MLP Tabular Regression #

This example trains an MLP on the UCI Auto MPG regression task. The prepared CSV has seven normalized numeric car features and one normalized target column for miles per gallon, so the model is just ordinary supervised tabular regression:

x1..x7 -> Linear -> ReLU -> Linear -> y.

Prepare the CSV once:

python3 scripts/datasets/download_example_data.py --auto-mpg
lake exe torchlean mlp --cpu --steps 1

The downloader writes normalized columns x1..x7,y. If you want to try your own tabular regression CSV, pass --csv PATH with the same columns.

CLI subcommand name used in terminal banners and error messages.

Instances For

    Default JSON loss-curve path for this command.

    Instances For

      Static minibatch size for the Auto MPG tabular loader.

      Instances For

        Auto MPG has seven numeric predictors after dropping car_name.

        Instances For

          Hidden width of the one-hidden-layer MLP.

          Instances For

            Regression target width: normalized miles-per-gallon.

            Instances For

              Shared MLP configuration used by shapes and the constructor.

              Instances For
                @[reducible, inline]

                Input shape: a minibatch of Auto MPG feature vectors.

                Instances For
                  @[reducible, inline]

                  Output shape: one scalar regression prediction per row.

                  Instances For

                    One-hidden-layer ReLU MLP from the public model API.

                    Instances For

                      Auto MPG as a public TorchLean dataset.

                      The only dataset-specific details here are the CSV path, header convention, batch size, and feature count. Runtime scalar selection stays inside Trainer, so the same dataset works for CPU, CUDA, compiled, eager, and checked scalar modes.

                      Instances For

                        Train the Auto MPG MLP with the public Trainer surface.

                        Instances For

                          CLI entrypoint for Auto MPG regression on CPU or CUDA.

                          Instances For