Log inStart free
LESSON 15.17 · 5 STAGES · 3 CONTROLS · 3 CHECKSPRO · PREVIEW

Policy evaluation and policy iteration

Watch a fixed policy get scored, improved and scored again until no arrow changes.


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

Go Pro · $8.25/mo
EXPLAINER · 15.17 · GRIDWORLD BAYSTART UP · SLIP 0.2 · γ 0.9
01
Stage 1 of 5 · Fixed policy
The start policy points every arrow up. Each move slips sideways with chance 0.2.
Explain it simply

A policy is a rule that gives each cell one arrow. Here the start policy points every arrow up. The goal pays 1, the pit costs 1 and every other step costs 0.04. The panel on the right shows how a move can slip to either side.

A 4 by 4 grid with a wall, a goal at the top right and a pit under it. The start policy points every arrow up. A move goes the intended way with chance 0.8.

policy arrowsvalue, goalnegative value, pit, changecell
0.000.000.00goal +10.00wall0.00pit −10.000.000.000.000.00start0.000.000.00the start policyhow one move slips0.80.10.1reward on entrygoal +1pit −1any other step −0.04γ = 0.9 · a bump into an edge or the wall stays put0.000.000.00goal +10.00wall0.00pit −10.000.000.000.000.00start0.000.000.00the start policyhow one move slips0.80.10.1reward on entrygoal +1pit −1any other step −0.04γ = 0.9 · a bump into an edge or the wall stays put
Toy: a 4×4 gridworld, one wall, a goal and a pit
STAGE 1 / 5
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
π(s)=a,p(s′∣s,a)\sy{pi}{param}{\pi}(s) = a, \quad p(\sy{v}{data}{s'} \mid s, a)
p=0.8 ahead,  0.1 to each sidep = 0.8 \text{ ahead}, \; 0.1 \text{ to each side}

The policy gives each cell one action; the slip spreads where it lands.

Common mix-ups

MYTHPolicy evaluation already turns the arrows toward the goal.

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

Predict, then reveal
3 CHECKS · PRO
Q01If the discount rises to 0.99, does the first evaluation need more or fewer sweeps?

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

PRO LESSON · YOU WATCHED STAGE 1 OF 5
Unlock the full explainer
  • 4 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.