Quickstart: Training a Small MLP #
Regression with a two-layer MLP on a synthetic grid:
- define the model with
nn.Sequential!, - build an in-memory dataset with
Data.fromTensors, - create a
Trainerwith an objective and optimizer, - call
trainer.train, then predict with the result.
Run:
scripts/lake.sh exe torchlean quickstart_mlpscripts/lake.sh exe torchlean quickstart_mlp --steps 20 --seed 3
Flags: --steps N, --seed S, --arithmetic, --execution, --device, and --show-backend.
Command name used in diagnostics and by the top-level example runner.
Instances For
Piecewise-linear regression target 0.8 relu(x₁ + x₂) - 0.4 relu(x₂ - x₁) + 0.2.
Instances For
Twenty-five grid points in [-1, 1]² with their targets.
Instances For
Command-line help for the simple MLP quickstart.