Realm

oa::ml::training

Module published by the oa::ml module.

MdRust public API

Public Types

Public Functions

pub fn drive_categorical_ppo<E, F>( trainer: &mut PpoTrainer<'_, '_>, model: &CategoricalActorCritic, environment: &mut E, make_evaluation_environment: F, config: &PpoDriverConfig, ) -> Result<PpoDriverReport>where E: Environment, F: FnMut() -> Result<E>,

Function Documentation

pub fn drive_categorical_ppo<E, F>( trainer: &mut PpoTrainer<'_, '_>, model: &CategoricalActorCritic, environment: &mut E, make_evaluation_environment: F, config: &PpoDriverConfig, ) -> Result<PpoDriverReport>where E: Environment, F: FnMut() -> Result<E>,
Drive a categorical PPO trainer against one vector environment to completion. The loop follows the trainer’s own pacing: while the trainer is not done, collect when the trainer needs collection, then apply one update step. Collection per rollout begins one environment transaction, acts and observes across the configured horizon with auto-reset of completed lanes, ends collection, and submits/waits the transaction; any recording failure aborts collection and cancels the transaction in pairs, matching the tutorial discipline. Evaluation runs every evaluation_interval completed rollouts and once after completion on a fresh environment from make_evaluation_environment, seeded independently of training. model is the policy under training — caller-owned exactly as the trainer borrows it — used for evaluation. Errors Returns environment, collection, update, or evaluation errors.