TorchLean API

NN.Examples.ModelZoo.Training

Model-Zoo Training Support #

Logging, runtime, and fixed-sample training helpers used by the runnable model examples.

Resolve the CUDA allocator-reporting cadence for a model-zoo run.

Instances For

    Training-log note recording the selected CUDA allocator-reporting cadence.

    Instances For

      Sample and report CUDA allocator state when the selected cadence is reached.

      Instances For

        Return whether a completed model-zoo step should emit a periodic report.

        Instances For

          Print the first and last losses recorded by a model-zoo training curve.

          Instances For

            Shared CLI and logging names for the built-in model-zoo examples.

            These are public so examples can stay short and readable. They live under ModelZoo; ordinary library code should usually use Trainer, Data, and optim directly.

            Standard location for a model-example training log under data/model_zoo.

            Instances For
              def NN.Examples.ModelZoo.orThrow {α : Type} (exeName : String) (result : Except String α) :
              IO α

              Lift a parser result into IO, prefixing failures with the executable name.

              Instances For

                Runtime device label used by example banners and notes.

                Instances For

                  device=... note string used by example logs.

                  Instances For

                    Model-zoo banner with the executable name, a short description, and the selected device.

                    Instances For

                      Two-line model-zoo banner: a headline with the selected device, then one detail line.

                      Instances For
                        def NN.Examples.ModelZoo.check (exeName msg : String) (b : Bool) :

                        Fail with a contextual error when an executable model check is false.

                        Instances For
                          def NN.Examples.ModelZoo.writeBeforeAfterLossLogPath (path : System.FilePath) (title : String) (steps : ) (beforeLoss afterLoss : Float) (notes : Array String := #[]) :

                          Write a before-and-after loss comparison to a JSON file.

                          Instances For
                            def NN.Examples.ModelZoo.writeBeforeAfterLossLog (dest : Runtime.Training.LogDestination) (title : String) (steps : ) (beforeLoss afterLoss : Float) (notes : Array String := #[]) :

                            Write a before-and-after loss comparison to the selected logging destination.

                            Instances For
                              def NN.Examples.ModelZoo.writeCurveLog (dest : Runtime.Training.LogDestination) (title : String) (curve : Runtime.Training.Curve) (seriesName : String := "loss") (notes : Array String := #[]) :

                              Write one scalar curve to the selected logging destination.

                              Instances For
                                def NN.Examples.ModelZoo.writeCurveTrainLog (dest : Runtime.Training.LogDestination) (title : String) (curve : Runtime.Training.Curve) (seriesName : String) (color : String := "#4e79a7") (notes : Array String := #[]) :

                                Write a single-curve training log with an explicit series color.

                                Use this when a command already has a Training.Curve and wants a TrainLog instead of the default "loss" curve writer.

                                Instances For

                                  Write a multi-series metric history as a TrainLog artifact.

                                  Use this when a command has a Training.MetricHistory with named, colored series and wants to write the usual TrainLog artifact without repeating the conversion code in every example.

                                  Instances For

                                    Write a prepared training log to a JSON file.

                                    Instances For

                                      Write a prepared training log to the selected destination.

                                      Instances For

                                        Fixed-sample run specialized to Float, returning a full per-step curve.

                                        Instances For