Robot Learning · Sim-to-Real Transfer and Robustness · M10-L3 · Intermediate
Detect When the Policy Is Out of Distribution
Experiment log · Scout at Meridian General Hospital
Experiment log, Meridian General Hospital, east corridor. Scout's tight policy was trained in the nominal simulator and works there every time. On the real floor it is slower to respond, and last Tuesday it clipped the pillar. Nobody noticed the change in its behaviour until the crash: its velocity readings had looked different for days.
You will write the monitor that would have noticed. Four small functions: describe the training readings by a mean and a covariance, score each new reading by how far it lies from that cloud in units of the cloud's own spread, choose a threshold from the training scores for a chosen false-alarm rate, and combine several scores into one alarm that hands Scout to the cautious policy. The page generates the logs, measures false alarms and detections on shifted logs, and replays the episodes with your alarms.
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.