TorchLean API

NN.Examples.Models.Common.Train

Shared Model Training Commands #

Example-side command runners for built-in model-zoo entries.

The trainer API provides Trainer.new, trainer.train, and trained prediction handles. This file owns repository command plumbing: parse model-zoo flags, check local files, run training, and print the standard summary.

def NN.Examples.Models.TrainCommand.runParsedWith {φ ρ : Type} (exeName : String) (args : List String) (parseFlags : List StringExcept String (φ × List String)) (banner : Runtime.Autograd.Torch.OptionsString) (train : Runtime.Autograd.Torch.OptionsφIO ρ) (finish : Runtime.Autograd.Torch.OptionsφρIO Unit) :

Run one parsed model-training command and finish with access to runtime flags and result.

Instances For
    def NN.Examples.Models.TrainCommand.runParsed {φ ρ : Type} (exeName : String) (args : List String) (parseFlags : List StringExcept String (φ × List String)) (banner : Runtime.Autograd.Torch.OptionsString) (train : Runtime.Autograd.Torch.OptionsφIO ρ) (print : ρIO Unit) :

    Run one parsed model-training command when the final printer only needs the trained result.

    Instances For
      def NN.Examples.Models.TrainCommand.regressionCsv {σ τ : Spec.Shape} (exeName : String) (args : List String) (defaultCsv defaultLogPath : System.FilePath) (defaultSteps : := 1) (defaultLr : Float := 1e-3) (banner : Runtime.Autograd.Torch.OptionsString) (train : Runtime.Autograd.Torch.OptionsModelZoo.CsvTrainFlagsIO (TorchLean.Trainer.TrainResult σ τ)) :

      CSV-backed regression command using the public trainer API.

      Instances For

        NPY-backed regression command using the public trainer API.

        Instances For

          Shared runner for the normal lake exe torchlean ... training commands.

          This is the common path for examples that load data, train once, and print the standard report. A model file should only define its own option record when it genuinely does more than training, for example text generation, probe evaluation, or a custom curriculum.

          Instances For

            Usage text for model examples using the shared runner.

            Instances For

              Run a public model-training command.

              Instances For