TorchLean API

NN.API.Public.Facade.Trainer.Results

TorchLean Trainer Results #

Public trained-result handles and verification reports for the unified trainer facade.

Uniform ℓ∞ verification request for a trained regression model.

The request is deliberately small: one center input and one radius. It maps cleanly to TorchLean's existing verifier stack:

  1. compile the trained forward model to verifier IR,
  2. seed the distinguished input node with an ℓ∞ box,
  3. run IBP,
  4. report the certified output interval.

The report is not a replacement for richer robustness specifications; it is the compact public door into the checked verifier path.

Instances For

    Public result of an ℓ∞ IBP verification run.

    Bounds are rendered as strings because the trained handle hides the runtime-selected scalar type inside a closure. That keeps the API usable from ordinary scripts while still running the verifier over the same scalar backend used for training.

    • nodes :

      Number of IR nodes in the compiled verifier graph.

    • outputDim :

      Flattened output dimension reported by the verifier.

    • lo : String

      Lower bound on the flattened output box.

    • hi : String

      Upper bound on the flattened output box.

    Instances For

      Print the verification summary to stdout.

      Instances For

        Result of training a regression trainer.

        The trained runner stays alive behind the returned closures, so callers can immediately reuse the trained model for inference without reopening the runtime API directly.

        Instances For

          Result of training from a step-indexed regression stream.

          Generated or resampled workloads may not have one static dataset to summarize: diffusion noising schedules, PDE collocation batches, RL replay-style batches, and similar loops. The trained model handle is the same one returned by ordinary training; the extra field is the explicit loss curve collected from a caller-provided evaluation sample.

          • result : TrainResult σ τ

            Trained model handle with prediction and verification closures.

          • Evaluation loss curve recorded during stream training.

          Instances For

            Result of training two regression trainers in one alternating stream.

            GAN-style examples need this shape: one checked model is stepped on one stream, another checked model is stepped on a related stream, and the report is a task-specific scalar such as total generator/discriminator loss. The public result still returns ordinary trained handles for both models, so post-training code uses predict instead of touching module state directly.

            • first : TrainResult σ₁ τ₁

              Trained handle for the first trainer.

            • second : TrainResult σ₂ τ₂

              Trained handle for the second trainer.

            • Task-specific curve recorded by the caller-provided evaluation function.

            Instances For

              One-line summary for the completed training run.

              Instances For

                Print the before/after training summary to stdout.

                Instances For

                  Run one regression prediction and print it with a user-provided label.

                  This is the small "train, then inspect one heldout example" helper used by tutorials.

                  Instances For

                    One-line summary for the trained stream run.

                    Instances For

                      Print the stream training summary to stdout.

                      Instances For

                        Run one prediction through the trained model produced by stream training.

                        Stream training carries an extra loss curve. This forwarding method keeps stream examples concise: call stream.predict x on the stream result instead of reaching through the trained handle field.

                        Instances For

                          Run several predictions through the trained model produced by stream training.

                          Instances For
                            def TorchLean.Trainer.Implementation.Regression.PairStreamTrainResult.summary {σ₁ τ₁ σ₂ τ₂ : Shape} (result : PairStreamTrainResult σ₁ τ₁ σ₂ τ₂) :

                            One-line summary for the two trained models.

                            Instances For

                              Print the trained-handle summary for both models.

                              Instances For
                                def TorchLean.Trainer.Implementation.Regression.PairStreamTrainResult.printCurveSummary {σ₁ τ₁ σ₂ τ₂ : Shape} (result : PairStreamTrainResult σ₁ τ₁ σ₂ τ₂) (metric : String := "loss") :

                                Print a before/after summary for the paired task curve.

                                Paired-model examples usually care about a coupled metric such as total GAN loss. That metric lives in result.curve, not in either trained handle alone, so this operation gives examples one standard before/after line without peeking at curve.values.

                                Instances For
                                  @[implicit_reducible]

                                  Result of training a general one-hot cross-entropy trainer.

                                  Sequence-model friendly trained handle: it owns the trained runner and gives callers ordinary Float prediction tensors. Text examples can then decode logits however they like without threading runtime runner/module state through the example.

                                  Instances For

                                    One-line summary for the completed training run.

                                    Instances For

                                      Print the before/after training summary to stdout.

                                      Instances For

                                        Run one prediction and print it with a user-provided label.

                                        Instances For

                                          Result of training a custom supervised trainer.

                                          The trained handle mirrors CrossEntropy.TrainResult: custom objectives affect training, but inference is still just "run the checked model on a Float tensor". Keeping that surface identical means examples can switch from a canned loss to a task-specific loss without rewriting their prediction/reporting code.

                                          Instances For

                                            One-line summary for the completed training run.

                                            Instances For

                                              Print the before/after training summary to stdout.

                                              Instances For

                                                Run one prediction and print it with a user-provided label.

                                                Instances For