TorchLean API

NN.Examples.Data.Loaders.Csv

CSV loader tutorial #

This tutorial mirrors the "data first" workflow people expect from PyTorch:

  1. Load a dataset from disk (CSV).
  2. Turn it into a fixed-size batched dataset.
  3. Train through the public Trainer API.

Generate a small deterministic regression dataset with python3 NN/Examples/Data/generate_small_data.py:

Build:

The tutorial code is compiled with the rest of TorchLean and is directly runnable as lake exe torchlean data_csv. It keeps data loading and training together so the parsed CSV shape can be checked before the first optimizer step.

Optional flags (tutorial-specific):

Public API used here:

Command name used in diagnostics and by the top-level example runner.

Instances For

    Printed when the CSV is absent, so the reader knows how to produce it rather than just seeing a file-not-found error.

    Instances For

      Two input features, matching the generated regression CSV.

      Instances For

        Hidden width; small enough that the printed parameter tensors fit on a screen.

        Instances For

          One regression target.

          Instances For

            A small 2-layer batched MLP 2 -> 8 -> 1.

            Instances For

              Command-line help for the CSV loader tutorial.

              Instances For

                Entry point: read the CSV, build the loader, then train the 2 -> 8 -> 1 MLP on it.

                Instances For