TorchLean API

NN.Examples.Models.Common.Train

Shared Model Training Commands #

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

The public trainer facade owns 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 TorchLean.Trainer.Command.runParsedWith {φ ρ : Type} (exeName : String) (args : List String) (parseFlags : List StringExcept String (φ × List String)) (banner : OptionsString) (train : OptionsφIO ρ) (finish : OptionsφρIO Unit) :

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

Instances For
    def TorchLean.Trainer.Command.runParsed {φ ρ : Type} (exeName : String) (args : List String) (parseFlags : List StringExcept String (φ × List String)) (banner : OptionsString) (train : OptionsφIO ρ) (print : ρIO Unit) :

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

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

      CSV-backed regression command using the public trainer API.

      Instances For

        NPY-backed classifier command using the public trainer API.

        Instances For

          NPY-backed regression command using the public trainer API.

          Instances For

            Forecast-window 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.

              • exeName : String

                CLI subcommand name, for example torchlean rnn.

              • defaultLogJson : System.FilePath

                Default JSON log path used when --log is omitted.

              • defaultSteps :

                Default number of optimizer steps when --steps is omitted.

              • description : String

                Model description used in banners.

              • parseData : List StringExcept String (δ × List String)

                Parse data flags, then leave device/training flags for the shared parser.

              • train : OptionsδModelZoo.LoggedTrainFlagsIO Unit

                Run the actual training body after data, device, and training flags have been parsed.

              Instances For

                Usage text for shared Trainer.Command.run model examples.

                Instances For
                  def TorchLean.Trainer.Command.run {δ : Type} (cfg : Config δ) (args : List String) :

                  Run a public model-training command.

                  Instances For