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

Returns and discounting

Watch one gridworld turn its rewards into a single number, the return.


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.08 · RETURN BAY6 MOVES · REWARD SUM 1
01
Stage 1 of 6 · Add the rewards
This episodic task ends at the goal after 6 moves. The undiscounted return adds its rewards: G = 1.
Explain it simply

The path on the grid is one episode of the policy. Each box holds the reward after one move. Only the last move into the goal pays, so the sum is 1. This plain sum is the undiscounted return.

The episode visits cells 0, 1, 5, 9, 10, 14, 15. Its 6 rewards are 0, 0, 0, 0, 0, +1, and their sum is 1.

agent and its pathweights γᵏ, slides, dashed horizon, start cellsgoal, +1, returnspit, −1ice tile (dashed outline)
start cells: ochre bars (ρ₀)01234567891011pit12131415goalrewards r₁, r₂, … of the episode0r10r20r30r40r5+1r6one episode, its rewardsG = 0 + 0 + 0 + 0 + 0 + 1 = 1start cells: ochre bars (ρ₀)01234567891011pit12131415goalrewards r₁, r₂, … of the episode0r10r20r30r40r5+1r6one episode, its rewardsG = 0 + 0 + 0 + 0 + 0 + 1 = 1
Toy: the 15.C1 gridworld, one seeded episode, then 120 steps with no end
STAGE 1 / 6
MATH · STAGE 1HOVER A SYMBOL OR A SHAPE
G=∑t=0T−1rt+1\sy{G}{out}{G} = \sum_{t=0}^{T-1} \sy{r}{ink}{r_{t+1}}
G=0+0+0+0+0+1=1G = 0 + 0 + 0 + 0 + 0 + 1 = 1

The undiscounted return adds every reward of the episode.

Common mix-ups

MYTHWithout a discount, an endless task still has a finite return.

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

Predict, then reveal
3 CHECKS · PRO
Q01With horizon 4, what is the episode's return?

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.