TorchLean API

NN.Runtime.Autograd.Train.Logging

Logging helpers for training loops #

This module defines a small, pluggable logging interface used by the training utilities. The core interface is monad-polymorphic (so it can stay pure), and Logger.stdout provides a convenient IO implementation.

Log levels and entries #

Severity of a log message emitted during training/evaluation.

Instances For

    Render a LogLevel as a lower-case string (used by LogEntry.render).

    Instances For

      A structured log message (level + string payload).

      • level : LogLevel

        Severity level for filtering or rendering.

      • message : String

        Human-readable message payload.

      Instances For

        Render a LogEntry as [level] msg.

        Instances For

          Logger interface #

          A small pluggable logger interface used by training utilities.

          The interface is compact: a logger consumes a level + string and can live in any monad m (including pure test monads). See Logger.stdout for a basic IO implementation.

          Instances For

            A logger that discards every message. Useful as a default.

            Instances For

              A simple IO logger that prints to stdout.

              Instances For
                def Runtime.Autograd.Train.Logger.logEntry {m : TypeType} (logger : Logger m) (entry : LogEntry) :

                Log a pre-built LogEntry.

                Instances For
                  def Runtime.Autograd.Train.Logger.info {m : TypeType} (logger : Logger m) (msg : String) :

                  Convenience wrapper for an .info message.

                  Instances For
                    def Runtime.Autograd.Train.Logger.warn {m : TypeType} (logger : Logger m) (msg : String) :

                    Convenience wrapper for a .warn message.

                    Instances For
                      def Runtime.Autograd.Train.Logger.error {m : TypeType} (logger : Logger m) (msg : String) :

                      Convenience wrapper for an .error message.

                      Instances For

                        Trainer integration #

                        def Runtime.Autograd.Train.Trainer.withLogger {m : TypeType} {state a : Type} (t : Trainer m state a) (logger : stateStepReport am Unit) :
                        Trainer m state a

                        Attach an arbitrary logger hook to a Trainer (called once per step).

                        Instances For
                          def Runtime.Autograd.Train.Trainer.withReportLogger {m : TypeType} [Monad m] {state a : Type} [ToString a] (t : Trainer m state a) (logger : Logger m) :
                          Trainer m state a

                          Attach a Logger to a Trainer by logging the pretty-printed StepReport each step.

                          This is analogous to printing per-step metrics in an imperative training script (e.g. a PyTorch loop).

                          Instances For