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

Off-policy evaluation

Score a new policy from old logs, and see where each estimate breaks.


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 · 20.19 · OFFLINE RL BAYV(π) 0.95 · LOGGED MEAN 0.35
01
Stage 1 of 6 · Logged episodes
Off-policy evaluation scores the target policy π from episodes of the behavior policy μ. Their mean return, 0.35, misses π's 0.95.
Explain it simply

Each row is a logged episode, and each square is a move. The arrow is the chosen action; a red arrow slipped and went the other way. A filled square ends in the last cell and earns 1. The average, 0.35, describes the behavior policy μ, called b in lesson 15.22. The target policy is worth 0.95.

20 episode rows of 3 moves each. The mean logged return is 0.35. The true value of π is 0.95.

logged moves, returnsimportance weightsslipped moves, correctionsestimates, true valueno logged move
01234start+1target π: right 0.90behavior μ: right 0.50red arrow: slipped (20%)movesG1→→←02←→→03←←←04←→→15→→←16→←←07←←←08→←→09←←→010→→→211→←→012←→←013→→→014←→→015←→→016→→→217→→→018→←→019←←→020→→←1estimates of V(π)0.00.51.01.52.02.5true V(π) 0.95logged mean0.3501234start+1target π: right 0.90behavior μ: right 0.50red arrow: slipped (20%)movesG1→→←02←→→03←←←04←→→15→→←16→←←07←←←08→←→09←←→010→→→211→←→012←→←013→→→014←→→015←→→016→→→217→→→018→←→019←←→020→→←1estimates of V(π)0.00.51.01.52.02.5true V(π) 0.95logged mean0.35
Toy: a 5-cell corridor, 20 logged episodes, π moves right 90% of the time
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
V(π)=Eπ[G]\sy{v}{out}{V(\pi)} = \mathbb{E}_{\pi}\big[\sy{g}{data}{G}\big]
Gˉμ=0.35,V(π)=0.95\bar G_{\mu} = 0.35,\quad V(\pi) = 0.95

The value of π is the return π gets on average.

Common mix-ups

MYTHA full effective sample size means the estimate is safe.

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

Predict, then reveal
3 CHECKS · PRO
Q01With the even behavior policy, does the effective sample size go up or down at 5 moves?

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.