Robot Learning · Deep and Continuous-Action Reinforcement Learning · M6-L2 · Advanced
Implement the PPO Clipped Objective
Experiment log · Scout at Meridian General Hospital
Experiment log, Meridian General Hospital, logistics corridor. The new Scout trainer reuses each batch of steps for several gradient epochs, and the first version of the loss was lifted from a forum post. Training is jittery: some batches barely change the policy, others change it so much that Scout forgets how to get around the pillar. The clip range is blamed, but nobody has checked what the loss does with a sample whose probability went the wrong way.
You will write the loss yourself in three small pieces: the clipped surrogate for each step, the gradient coefficient it passes to the policy (so you can see exactly which samples it silences), and the two diagnostics, approximate KL and the fraction outside the clip range, that a PPO log shows next to it. Every batch is 200 steps of the Scout hall under a Gaussian policy with exact log-probabilities.
Your task
Lab complete: post-mortem
You have passed every stage. Now connect it back to the theory and move on:
Output
What Python can I use?
Plain Python with math and heapq. Your code runs in a background worker: an endless loop is stopped after a few seconds and the page stays usable. It runs in your browser and is never sent anywhere.