Level 13 (after Lessons 13.2 and 13.3) · Time 3 to 5 hours, mostly waiting · Difficulty 3 of 5
Train PPO on the reach task and report the result the way a paper should: five training seeds, each evaluated deterministically on 100 initial states that training never used, summarized as an interquartile mean with a bootstrap interval. Add one ablation with exactly the same budget, and say what it changed. The algorithm can be the course’s (mjcourse.rl.ppo) or your own; the experiment is what this project grades.
rl_protocol.py fixes the task (ReachEnv, joint-delta actions), the budget (100 000 steps), the seeds (0 to 4), the held-out states (reset seeds 10 000 to 10 099), the evaluation and the report. Read it; do not edit it.starter.py asks for ABLATION, a sentence, and train(seed, variant, budget), which returns (act, steps).The tests train all ten runs in parallel processes: about 45 s on 48 cores.
The reference trains the course’s PPO (16 environments, 128 steps each per iteration, so 100 000 steps become 48 iterations and 98 304 steps). It ablates PPO’s central mechanism, the clipping, by raising the clip range from 0.2 to 10. That leaves ten epochs of unconstrained updates on each batch.
| Measure | Main (clip 0.2) | Ablation (clip 10) | Main − ablation, by seed |
|---|---|---|---|
| held-out success, per seed | 1.00, 1.00, 1.00, 1.00, 1.00 | 0.93, 1.00, 0.74, 0.91, 0.96 | |
| success, IQM [95% interval] | 1.000 [1.000, 1.000] | 0.933 [0.797, 0.987] | +0.092 [+0.028, +0.182] (mean) |
| steps per episode, IQM | 8.53 [8.38, 8.83] | 14.3 [9.7, 31.5] | −9.6 [−20.3, −2.6] (mean) |
| final distance (m), mean | 0.015 | 0.019 | −0.004 [−0.007, −0.001] |
On seed 0, the ablation’s KL divergence between successive policies was 0.27 per iteration in the last iteration, against 0.011 with clipping.
Read the table with three things in mind:
MJC_IMPL=starter pytest projects/p11_ppo_reach
pytest projects/p11_ppo_reach
Five tests:
act is deterministic and does not change after seeing other observations;python tools/mutate_project.py p11_ppo_reach checks the three mutants in mutants.json (about 3 minutes).
act updates the running mean and variance, the policy changes while it is being evaluated, and the result depends on the order of the evaluation states. The same test catches it: an observation seen first and seen again later gets a different action.solution.py, about 10 lines: the experiment, not the algorithm, is the work.