Skip to main content

Module ppo

Module ppo 

Source
Expand description

PPO trainer (Burn backend).

After phase 5 of the Burn migration (#82), Burn is the only tensor backend in the workspace. The historical train::ppo_burn parallel sibling has been collapsed back into train::ppo. The trainer struct retains its PPOTrainerBurn<B, P, O> name because Burn’s optimizer-consumes-module ownership model is structurally different from a hypothetical in-place trainer.

§Contents

  • actor_learner — single-host asynchronous actor-learner runner (N inference-only actor threads feeding one learner over crossbeam-channel; Phase 2 of the distributed-training epic #265).
  • configPPOConfig hyperparameters / builder API.
  • statsTrainingStats / AggregatedStats per-update metrics.
  • loss — backend-generic PPO loss math (policy/value/entropy) and the generate_minibatch_indices helper.
  • trainerPPOTrainerBurn<B, P, O> that owns the policy module (Burn’s optimizer-consumes-module ownership model) and exposes a train_step that runs the surrogate-loss / gradient-step / KL early stop logic.

Re-exports§

pub use actor_learner::ActorChannels;
pub use actor_learner::ActorHandle;
pub use actor_learner::ActorStats;
pub use actor_learner::AsyncActorLearnerConfig;
pub use actor_learner::LearnerReport;
pub use actor_learner::actor_thread;
pub use actor_learner::learner_loop;
pub use actor_learner::load_policy_from_broadcast;
pub use actor_learner::serialize_policy;
pub use actor_learner::spawn_actor;
pub use config::PPOConfig;
pub use loss::compute_entropy_loss;
pub use loss::compute_policy_loss;
pub use loss::compute_value_loss;
pub use loss::generate_minibatch_indices;
pub use loss::scalar_f64;
pub use recurrent_trainer::RecurrentPPOTrainer;
pub use stats::AggregatedStats;
pub use stats::TrainingStats;
pub use trainer::PPOTrainerBurn;

Modules§

actor_learner
Single-host asynchronous actor-learner PPO (IMPALA-style topology).
config
PPO configuration and hyperparameters
loss
PPO loss math (Burn backend).
recurrent_trainer
Recurrent PPO trainer (Burn backend).
stats
Training statistics for PPO
trainer
Burn-backend PPO trainer (phase 3 of the Burn migration, #80).