An episode gives rewards , , , and then ends. With , compute the returns . Which recursion lets you compute them quickly?
Reinforcement learning, Returns and discounting
Level L2 Elementary. Length Short. Nature Mat Mathematical.
What's being asked
Whether you can compute discounted returns and use the recursion .
Key idea
The return is . It satisfies with at the end of the episode, so work backwards from the last reward.
Steps
- Write the recursion , and set because the episode has ended.
- Work backwards for and : , and .
- Continue backwards for and : , and .
- Check directly: . It matches.
Common mistakes
- Using the wrong index: the reward after taking the action at time is , not .
- Forgetting to discount: the reward steps later is multiplied by .
- Computing forwards and repeating the powers of . The backward recursion needs one multiplication per step.
How long your answer should be
5–6 lines of arithmetic.
Read this
Previous in Reinforcement learning: Write the Q-learning update. With , , , reward and , compute the new . Why is Q-learning called off-policy?
Next in Reinforcement learning: An agent receives reward at every step forever, with . What is its return? How many steps does it take to collect at least of that return, and what does this say about the "effective horizon" ?