Lecture 11�� n-Step Bootstrapping
1
Institute for Data Science & Artificial Intelligence
Lecturer: Ercan Atam
Course: DSAI 542-Reinforcement Learning
2
List of contents for this lecture
3
Relevant readings for this lecture
4
Introduction (1)
5
changing action and bootstrapping.
scales for action and bootstrapping.
and then the control problem.
Introduction (2)
6
n-step TD prediction (1)
7
n-step TD prediction (2)
8
n-step TD prediction (3)
Fig: The idea of n-step returns for n=3
9
n-step TD prediction (4)
Fig: How n-step bootstrapping deals with the end of episodic sequence, where n=3.
10
n-step TD prediction (5)
11
n-step TD prediction (6)
We are at time “t+1” and use
the estimate at the previous time “t”
12
n-step TD prediction (7)
13
n-step TD prediction (8)
14
n-step TD prediction algorithm
15
Convergence of n-step TD prediction
Theorem: error reduction property of n-step TD prediction
▶ Assuming an infinite number of steps/episodes and an appropriate step-size according to
n-step TD prediction converges to the true value.
▶ In a more practical framework with limited number of steps/episodes:
▶ Choosing the best n-step lookahead horizon is an engineering degree of freedom.
▶ This is highly application-dependent (i.e., no predefined optimum).
▶ Prediction/estimation errors can remain due to limited data.
(Source, W. Kirchgässner, M. Schenke, O. Wallscheid and D. Weber, RL Course Material, Paderborn University, 2020)
16
n-step TD prediction algorithm: a simple run
17
n-step TD prediction methods on the random walk (1)
18
n-step TD prediction methods on the random walk (2)
19
Note: Based on the results of the 5-state random walk process, it seems the larger n, the better results are. However, this example is of small size to come to a definite answer!
Next, let us construct an empirical test for a larger random walk process where
n-step TD prediction methods on the random walk (3)
20
n-step TD prediction methods on the random walk (4)
21
n-step methods can be combined with SARSA in a straightforward way to produce an on-policy TD control method, which we call n-step SARSA.
n-step SARSA (1)
22
n-step SARSA (2)
Fig: The backup diagrams for the spectrum of n-step methods for state–action values (including the backup diagram of the n-step expected SARSA) .
23
n-step SARSA algorithm
24
n-step SARSA application to gridworld
Fig: Executed updates (denoted by arrows) for different n-step SARSA methods during an episode.
25
n-step Expected SARSA (1)
Fig: The backup diagrams for the spectrum of n-step methods for state–action values (including the backup diagram of the n-step Expected SARSA) .
26
n-step Expected SARSA (2)
27
n-step off-policy learning with importance sampling (1)
28
n-step off-policy learning with importance sampling (2)
…
29
n-step off-policy learning with importance sampling (3)
…
30
Off-policy n-step SARSA algorithm
31
n-step off-policy learning without importance sampling: the tree backup approach (1)
Q1: Is off-policy learning possible without importance sampling?
A1: Yes! Q-learning and Expected SARSA are such examples for the one-step case.
Q2: Is there an “n-step” off-policy learning without importance sampling?
A2: Yes! It is the tree backup approach we describe next…
32
n-step off-policy learning without importance sampling: the tree backup approach (2)
Fig.: the 3-step tree-backup update
(For the last state, all the actions are considered to have not (yet) been selected.)
use the estimates of their values in forming the target for the update.
33
n-step off-policy learning without importance sampling: the tree backup approach (3)
Fig.: the 3-step tree-backup update
Update Rule
Update is based on the estimated action values of the leaf nodes of the tree.
by the action’s probability of being selected under the target policy.
to all the leaf nodes in the tree.
Actions
dangling action
spinal action
(=action taken)
34
n-step off-policy learning without importance sampling: the tree backup approach (4)
Fig.: the 3-step tree-backup update
One-step return:
Two-step tree-backup return:
n-step tree-backup return:
(same as Expected SARSA)
35
n-step off-policy learning without importance sampling: the tree backup approach (5)
References �(utilized for preparation of lecture notes or Matlab code)
36