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

Monte Carlo prediction and control

Watch whole random walks turn into value estimates, then into a policy.


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 · 15.19 · RL BAYEPISODE 1 · 9 MOVES · ENDS RIGHT
01
Stage 1 of 6 · One episode
An episode starts at C and moves left or right at random. Only the right end pays a reward of +1.
Explain it simply

The strip shows one walk in time order. It goes C, B, A, B, C, B, C, D, E, then off the right end. Every move pays 0 points, except that last move, which pays 1. Each circle is one visit to a state.

Episode 1 visits C, B, A, B, C, B, C, D and E. It ends at the right end with reward +1.

statesreturns and valuestrue valueother visit ruleerror
startleft endright end0ABCDE+1R0Ct00Bt10At20Bt30Ct40Bt50Ct60Dt7+1Et8+1t9one episode9 moves · the reward is +1 at the right endstartleft endright end0ABCDE+1R0Ct00Bt10At20Bt30Ct40Bt50Ct60Dt7+1Et8+1t9one episode9 moves · the reward is +1 at the right end
Toy: the 7-state random walk, γ = 0.9, seeded episodes
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
S0, R1, S1, R2, …, RT\sy{S}{data}{S_0},\ \sy{R}{out}{R_1},\ S_1,\ R_2,\ \dots,\ \sy{R}{out}{R_T}
T=9, R9=1T = 9,\ R_{9} = 1

An episode is a run of states and rewards up to an end.

Common mix-ups

MYTHA greedy agent learns the value of every move.

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

Predict, then reveal
3 CHECKS · PRO
Q01With 1,000 episodes instead of 100, does the error of V rise or fall?

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.