Log inStart free
LESSON 19.03 · 6 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Hindsight experience replay

Watch a missed walk turn into a lesson for the cell it did reach.


Pro lesson. Stage 1 is free to watch. Pro opens all 6 stages, 3 controls and 3 checks, in this lesson and every other.

Go Pro · $8.25/mo
EXPLAINER · 19.03 · REPLAY BAYEPISODE 50 · GOAL 3 · END 22
01
Stage 1 of 6 · One episode
Episode 50 aims at goal cell 3. It ends at cell 22, so all 24 sparse rewards are 0.
Explain it simply

The teal line is the agent's walk from cell 0 in the top left. It tried to reach the cobalt square, cell 3, but its 24 steps ran out. The reward is 1 only on the goal, so every square in the row on the right stays 0. A learner that keeps only this goal learns nothing from the walk.

Maze of 25 cells. The walk of episode 50 goes from cell 0 to cell 22. The goal is cell 3. A row of 24 rewards, all 0.

maze and walkrelabeled goalreward 0, missedgoal, reward 1dashed cell: no stored route
0123456789101112131415161718192021222324startgoalendgoal 3step 124episode 50reward per stepreward 1 only on cell 3: 0 of 240123456789101112131415161718192021222324startgoalendgoal 3step 124episode 50reward per stepreward 1 only on cell 3: 0 of 24
Toy: 19.C1 maze, 200 episodes, ε 0.2, γ 0.9
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
rt=[ st+1=g ]\sy{r}{grad}{r_t} = [\,\sy{s}{data}{s_{t+1}} = \sy{g}{out}{g}\,]
g=3, sT=22: rt=0 for all 24 stepsg = 3,\ s_T = 22:\ r_t = 0 \text{ for all } 24 \text{ steps}

A step earns 1 only when it lands on the goal.

Common mix-ups

MYTHRelabeled goals are fake wins that teach wrong moves.

The fix, and 1 more mix-up with the diagram to show them, come with Pro.

Predict, then reveal
3 CHECKS · PRO
Q01After the same episodes, does plain replay reach more or fewer goals than future cells?

Make your guess, then test it in the diagram. All 3 checks come with Pro.

PRO LESSON · YOU WATCHED STAGE 1 OF 6
Unlock the full explainer
  • 5 more stages and 3 live controls
  • 2 mix-up cards and 3 predict-then-reveal checks
  • Watch it as a narrated video, in three voices
  • Every Pro lesson and capstone · 656 in total

$99 a year, or $15 a month. Cancel any time.