核心思想就是在做bootstrapping之前再向前多走几步
7.1 n-step TD Prediction
temporal difference 扩展了n步,这就被称为n-step TD methods
n-step returns
其中 Vt:S→R V t : S → R 这里是在t时刻对 vπ v π 的估计
因为又向后看了几步,所以只有等到得到
Rt+n
R
t
+
n
和计算出
Vt+n−1
V
t
+
n
−
1
之后才能做更新
error reduction property of n-step returns
the worst error of the expected n-step return is guaranteed to be less than or equal to
γn
γ
n
times the worst error under
Vt+n−1
V
t
+
n
−
1
:
这表明所有的n-step TD方法在合适的技术条件下都收敛到正确的预测
7.2 n-step Sarsa
跟之前介绍的Sarsa相比,只有G变成了n-step returns
更新公式也基本没有发生变化
![The backup diagrams for the spectrum of n-step methods for state-action values](https://i-blog.csdnimg.cn/blog_migrate/c70d5765c58559c244a3eaff8c220246.png)
![n-step Sarsa for estimating](https://i-blog.csdnimg.cn/blog_migrate/e0bffd361917dc1f281ece59734c07dd.png)
对于上图展示的Expected Sarsa。跟n-step Sarsa类似,除了最后考虑的一项不同。
这里的不同点有 Gt:t+n≐Gt for t+n≥T G t : t + n ≐ G t for t + n ≥ T ,
其中 V¯t(s) V ¯ t ( s ) 是 expected approximte value of state s
7.3 n-step On-policy Learning by Importance Sampling
这一节有关于off-policy learning很好的介绍。off-policy learning就是 学习一个policy π π 的值,同时遵循另外一个policy b的experience。通常, π π 是对当前action-value估计的greedy policy,而b是一个跟具有探索性的policy,或许是 ε-greedy ε -greedy
还是要用上 importance sampling ratio
更新公式
off-policy form n-step Sarsa
![off-policy n-step Sarsa](https://i-blog.csdnimg.cn/blog_migrate/6b88190936f35e92512e27379646b35a.png)
7.4 *Per-decision Off-policy Methods with Control Variates
A more sophisticated approach would use per-decision importance sampling ideas
n-step returns可以写为
Gt:h=Rt+1+γGt+1:h,t<h<T,
G
t
:
h
=
R
t
+
1
+
γ
G
t
+
1
:
h
,
t
<
h
<
T
,
off-policy definition of the n-step return ending at horizon
同时有 Gh:h≐Vh−1(Sh) G h : h ≐ V h − 1 ( S h )
上式7.13中的第二项被称为 control variate
control variate 不会改变期望更新,因为 在5.9节介绍过,importance sampling ratio的期望值是1。
An off-policy form with control variates
如果 h<t h < t ,则递归以 Gh:h≐Qh−1(Sh,Ah) G h : h ≐ Q h − 1 ( S h , A h ) 结束;如果 h≥T h ≥ T ,则递归以 GT−1:T≐RT G T − 1 : T ≐ R T 结束。
control variates就是一种减小方差的方法
7.5 Off-policy Learning Without Importance Sampling: The n-step Tree Backup Algorithm
不需要importance sampling的off-policy方法
tree-backup n-step return的一般形式
当n=1时, GT−1:T≐RT G T − 1 : T ≐ R T
上述action-value用于n-step Sarsa
![n-step Tree Backup for estimating](https://i-blog.csdnimg.cn/blog_migrate/2b4e3557cc2c09a6e7ef896bb575f26a.png)
7.6 *A Unifying Algorithm: n-step Q(δ) Q ( δ )
跟前面描述的类似,就是往前看的方式变了,其他的都是一样的,看下图
改写7.16的形式为如下:
把其中的 π(At+1|St+1) π ( A t + 1 | S t + 1 ) 替换成importance-sampling ratio ρt+1 ρ t + 1
对于 t<h≤T t < h ≤ T ,如果 h<T h < T ,则递归式最后以 Gh:h≐0 G h : h ≐ 0 结束;如果 h=T h = T ,则递归式最后以 GT−1:T≐RT G T − 1 : T ≐ R T 结束。