Skip to content

simulo.Trainer

The training-orchestration contract — run and persist a training job.

A trainer owns the RL loop: it drives an environment, updates the policy, and reads/writes checkpoints. Structural mirror of simulo.core.trainer.Trainer.

Trainer.train(max_iterations: int) -> Dict[str, Any]

Run the training loop for up to max_iterations and return summary metrics.

The returned mapping includes at least the final iteration count and reward statistics (implementation-defined keys).

Trainer.save(path: str) -> None

Write the trainer’s full state (policy + optimizer) to path.

Trainer.load(path: str) -> None

Restore trainer state previously written by save().


Declared as:

@runtime_checkable
class TrainerProtocol(Protocol)