Skip to content

distill::convergence::ConvergenceTracker

More...

Public Functions

Name
init(self self, ConvergenceConfig config)
ConvergenceState state(self self)
str step(self self, float loss)

Protected Attributes

Name
_config
_state

Detailed Description

class distill::convergence::ConvergenceTracker;
Tracks training loss, detects plateaus, and enforces two-tier stopping.

Call ``step(loss)`` after each training iteration. The return value is one of:

* ``"continue"`` — normal operation, keep training.
* ``"warning"`` — loss exceeded the warning threshold (issued once per run).
* ``"hard_stop"`` — loss exceeded the hard-stop threshold; halt immediately.
* ``"converged"`` — loss sustained below target for patience steps with no
  min_delta improvement; training is complete.

Public Functions Documentation

function init

__init__(
    self self,
    ConvergenceConfig config
)
Initialise the tracker with per-specialist convergence parameters.

Args:
    config: Convergence thresholds and plateau detection settings.

function state

ConvergenceState state(
    self self
)
Return the mutable tracking state (read-only for callers).```


### function step

```python
str step(
    self self,
    float loss
)
Record a loss value and return the training status.

Args:
    loss: The current distillation loss value.

Returns:
    One of ``"continue"``, ``"warning"``, ``"hard_stop"``, or ``"converged"``.

Protected Attributes Documentation

variable _config

_config;

variable _state

_state;

Updated on 2026-10-09 at 03:59:43 +0000