simulo.Trainer
The training-orchestration contract — run, evaluate, 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.
train()
Section titled “train()”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).
evaluate()
Section titled “evaluate()”Trainer.evaluate(checkpoint: Optional[str] = ..., num_episodes: int = ...) -> Dict[str, Any]Roll out the current (or checkpoint-loaded) policy without learning.
Returns evaluation metrics such as mean episode return over
num_episodes episodes.
save()
Section titled “save()”Trainer.save(path: str) -> NoneWrite the trainer’s full state (policy + optimizer) to path.
load()
Section titled “load()”Trainer.load(path: str) -> NoneRestore trainer state previously written by save().
Declared as:
@runtime_checkableclass TrainerProtocol(Protocol)