TorchLean API

NN.API.Public.Facade.Trainer.Eval

TorchLean Public Trainer Methods #

Unified trained result and public methods on Trainer.Handle.

Evaluate one Float input through a runtime runner and return a Float output.

Instances For

    Evaluate one input through a custom-loss trainer without first running training.

    Instances For

      Build the regression dispatch record used by Handle.train.

      Instances For

        Build the cross-entropy dispatch record used by Handle.train.

        Instances For
          def TorchLean.Trainer.Implementation.customHandle {σ τ : Shape} (trainer : Handle σ τ) (loss : {α : Type} → [inst : Runtime.TensorScalar α] → [inst_1 : DecidableEq Shape] → Runtime.Autograd.TorchLean.Program α [τ, τ] Shape.scalar) :
          Custom σ τ

          Build the custom-loss dispatch record used by Handle.train.

          Instances For
            def TorchLean.Trainer.Handle.eval {σ τ : Shape} (trainer : Handle σ τ) (x : Tensor.T Float σ) :

            Evaluate one input using the trainer's current model and runtime settings.

            Inference before any training call. After training, use the returned trained handle's trained.eval / trained.evalBatch methods to evaluate the trained parameters.

            Instances For
              def TorchLean.Trainer.Handle.evalBatch {σ τ : Shape} (trainer : Handle σ τ) (xs : List (Tensor.T Float σ)) :

              Evaluate a list of inputs using the trainer's current model and runtime settings.

              Instances For

                Result returned by the unified public Trainer.train method.

                Instances For

                  The before/after scalar summary for this training run.

                  Instances For

                    One-line summary suitable for quickstarts and scripts.

                    Instances For

                      Print the standard before/after training summary.

                      Instances For

                        Evaluate one input using the trained model.

                        Instances For

                          Evaluate a list of inputs using the trained model.

                          Instances For

                            Print one prediction from a unified trained handle.

                            Instances For

                              Verify an ℓ∞ input ball for a trained regression handle.

                              Instances For
                                @[implicit_reducible]
                                def TorchLean.Trainer.Handle.train {σ τ : Shape} (trainer : Handle σ τ) (data : Dataset σ τ) (trainOptions : TrainOptions := { }) (probes : List (Probe σ) := []) :
                                IO (TrainResult σ τ)

                                Train a unified public trainer.

                                Main user-facing training method: one trainer value, one task field, and one trained result.

                                Instances For
                                  def TorchLean.Trainer.Handle.trainStreamFloat {σ τ : Shape} (trainer : Handle σ τ) (opts : Options) (sampleAt : SupervisedSample Float σ τ) (evalSample : SupervisedSample Float σ τ) (trainOptions : TrainOptions := { }) (curveEvery cudaMemWatch : := 0) (onEval : String(Tensor.T Float σIO (Tensor.T Float τ))IO Unit := fun (x : ) (x_1 : String) (x_2 : Tensor.T Float σIO (Tensor.T Float τ)) => pure ()) :

                                  Train a unified regression trainer from a Float sample stream.

                                  Generated-data examples use this when there is no fixed Dataset to hand to trainer.train.

                                  Instances For
                                    def TorchLean.Trainer.Handle.trainPairStreamFloat {σ₁ τ₁ σ₂ τ₂ : Shape} (first : Handle σ₁ τ₁) (second : Handle σ₂ τ₂) (opts : Options) (firstSampleAt : SupervisedSample Float σ₁ τ₁) (secondSamplesAt : List (SupervisedSample Float σ₂ τ₂)) (evalTotal : (Tensor.T Float σ₁IO (Tensor.T Float τ₁))(Tensor.T Float σ₂IO (Tensor.T Float τ₂))IO Float) (trainOptions : TrainOptions := { }) (curveEvery : := 1) (cudaMemWatch : := 0) :

                                    Train two unified regression trainers from coupled Float streams.

                                    GAN-style examples use this path when two regression trainers have to step together, without opening the lower-level runtime modules directly.

                                    Instances For
                                      def TorchLean.Trainer.Handle.trainSelectedCrossEntropy {σ τ : Shape} {α : Type} [Runtime.SemanticScalar α] [DecidableEq Shape] [ToString α] [Runtime.Scalar α] (trainer : Handle σ τ) (opts : Options) (data : Dataset σ τ) (trainOptions : TrainOptions := { }) (probes : List (Probe σ) := []) :

                                      Train a unified cross-entropy trainer after the scalar type has already been selected.

                                      Advanced scalar-selected cross-entropy training. Use this path from dispatchers such as ModelZoo.runAnyOrFloatNoCast, where the callback already has a concrete scalar α.

                                      Instances For