TorchLean API

NN.Examples.Data.Loaders.Csv

CSV loader tutorial (transforms + minibatches + scheduler) #

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

  1. Load a dataset from disk (CSV).
  2. Build a transform pipeline (Data.Transforms.Compose).
  3. Wrap the per-sample dataset in a minibatch loader (Data.batchLoader).
  4. Train with a learning-rate scheduler.

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

Build:

The tutorial code is compiled with the rest of TorchLean. For command-line model training, use the torchlean executable examples in NN/Examples/Models.

Optional flags (tutorial-specific):

Public API used here:

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

Instances For

    Load the CSV dataset, then apply a small input transform pipeline.

    The transform pipeline is written once for the chosen scalar type α:

    • normalize (here: mean=0, std=1, so it is an easy-to-read "template"), then
    • scale inputs by 0.5.
    Instances For