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

Prioritized replay

Watch a DQN pick the transitions with the largest errors more often.


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 · 17.05 · REPLAY BAYMAX |δ| 1.12 · 834 OF 1,000 BELOW 0.05
01
Stage 1 of 6 · The buffer
The replay buffer holds 1,000 transitions, oldest on the left. Each bar is one TD error.
Explain it simply

Each thin bar is one step the agent took. Its height shows how wrong the network is about that step. 834 of the 1,000 bars are below 0.05. The tallest bar is the move from cell 7 to P. A random pick mostly lands on bars that teach little.

1,000 bars, one per stored transition. 834 TD errors are below 0.05. The largest is −1.12, from cell 7 to P.

transitions, picksα, β, IS weightsTD errors, pitpriorities, Q error
the game · step 1,000012G45P7891011S131415replay buffer at step 1,000 · TD error |δ|oldestnewestticks: 33 moves into G or Pδ −1.12the game · step 1,000012G45P7891011S131415replay buffer at step 1,000 · TD error |δ|oldestnewestticks: 33 moves into G or Pδ −1.12
Toy: the 17.C1 grid game, a buffer of 1,000, 16 picks per update, 6,000 steps
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
δi=yi−Q(si,ai)\sy{d}{grad}{\delta_i} = \sy{y}{param}{y_i} - \sy{q}{out}{Q(s_i,a_i)}
δ=−1.00−(0.12)=−1.12\delta = -1.00 - (0.12) = -1.12

The TD error is the target minus the current Q-value.

Common mix-ups

MYTHPrioritized replay always learns faster.

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

Predict, then reveal
3 CHECKS · PRO
Q01If α is 0, which bars stand above the dashed line?

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.