Distillation with Checkpointing
CLI Equivalent: apr distill --method kl --checkpoint-dir ./checkpoints --save-every 500 teacher.apr student.apr
What This Demonstrates
Distillation training loop with periodic checkpoint saving and resume capability. Enables long-running distillation jobs to survive interruptions and resume from the last saved state.
Run
cargo run --example distill_checkpoint
Key APIs
DistillationLoss::new(temperature, alpha)-- configure distillation lossCheckpoint::save(path, model, optimizer, step)-- serialize training stateCheckpoint::load(path)-- restore model, optimizer, and step counterCheckpointSchedule::every(n_steps)-- configure save frequency