Training Results #
Regression, cross-entropy, and custom losses all return the same trained-model type.
A Result keeps a parameter snapshot of the trained model. Prediction and verification use it
directly. Result.state reads the parameters back as Float tensors and Result.save writes
them with Checkpoint.State.save, so a trained model can be stored and later restored with
Trainer.load. Results are produced by Session.finish.
A trained TorchLean model.
The result retains its parameter snapshot through prediction, state-reading, and verification closures. Continued training of the source session does not change the result.
The runtime state lives in the binary32 scalar selected by RunConfig.arithmetic (Float32 or
ExecFloat.Binary 8 23). state and save read it back as Float, which is exact because every
binary32
value is a binary64 value.
- reportValue : TorchLean.Trainer.Report
- readState : IO (TorchLean.nn.State Float self.stateShapes)
- saveState : System.FilePath → IO Unit
- predictOne : TorchLean.Tensor Float σ → IO (TorchLean.Tensor Float τ)
- runVerification (center : TorchLean.Tensor Float σ) (radius : Float) : TorchLean.Verification.Norm → TorchLean.Verification.Property → TorchLean.Verification.Algorithm → IO TorchLean.Verification.Report
Instances For
Construct an opaque trained-model result at the trainer implementation boundary.
Loss progress, step count, and runtime arithmetic for the completed run.
Read the trained parameters and persistent buffers as Float tensors.
The runtime holds them in binary32 (Float32 or ExecFloat.Binary 8 23); reading them back to
binary64 is
exact. The layout result.stateShapes equals nn.stateShapes of the trained model, which is what
Checkpoint.State.save and Checkpoint.State.load expect.
Save the trained state with Checkpoint.State.save; restore it with Trainer.load.
Run several Float inputs through the trained model.
Verify the trained model over a region around center.
property and algorithm have defaults, so checking output bounds needs only center and
radius.
One-line summary for the completed training run.
Instances For
A trained model returned by step-indexed stream training.
Generated or resampled workloads may not have one static dataset to summarize. The ordinary training result is paired with the evaluation curve collected from a caller-provided sample.
- trained : Result σ τ
Trained model result.
- curve : Training.Curve
Evaluation loss curve recorded during stream training.
Instances For
One-line summary for the trained stream run.
Instances For
Print the stream training summary.
Instances For
Run one prediction through the trained stream result.
Instances For
Run several predictions through the trained stream result.
Instances For
Two trained regression models and the coupled metric recorded by alternating updates.
- first : Result σ₁ τ₁
Trained result for the first model.
- second : Result σ₂ τ₂
Trained result for the second model.
- curve : Training.Curve
Task-specific curve recorded by the caller-provided evaluation function.
Instances For
One-line summary for the two trained models.
Instances For
Print the training summary for both models.
Instances For
Print the endpoints of the coupled metric curve.