Skip to main content

Module trainer

Module trainer 

Source
Expand description

Behavioral Cloning trainer (Burn backend).

Sibling to crate::train::a2c::trainer::A2cTrainer and crate::train::ppo::trainer::PPOTrainerBurn. BcTrainer reuses the same policy (MlpBurnPolicy), optimizer (BurnOptimizer) and the Option<P> move-through-step ownership model (Burn’s Optimizer::step consumes the module by value). It DIVERGES from every RL trainer in loop shape:

  • No environment interaction. Training is a supervised epoch loop over a fixed Demonstrations dataset.
  • No advantages / returns / entropy. The objective is the plain cross-entropy of the expert action (compute_bc_loss); the policy’s value head is ignored.
  • Many gradient steps per call. BcTrainer::train_epoch performs one step per minibatch (ceil(len / batch_size) steps per epoch), shuffling the example order from the trainer’s seeded RNG so two runs with the same BcConfig::seed produce identical minibatch order and stats.

Structs§

BcEpochStats
Per-epoch behavioral-cloning statistics.
BcTrainer
Burn-backend Behavioral Cloning trainer.