Chapter 7 n-step Bootstrapping

核心思想就是在做bootstrapping之前再向前多走几步


7.1 n-step TD Prediction

The backup diagrams of n-step methods
temporal difference 扩展了n步,这就被称为n-step TD methods

n-step returns

G t : t + n R t + 1 + γ R t + 2 + + γ n 1 R t + n + γ n V t + n 1 ( S t + n )

其中 V t : S R 这里是在t时刻对 v π 的估计

因为又向后看了几步,所以只有等到得到 R t + n 和计算出 V t + n 1 之后才能做更新

V t + n ( S t ) V t + n 1 ( S t ) + α [ G t : t + n V t + n 1 ( S t ) ] , 0 t T

n-step TD for estimating

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 times the worst error under V t + n 1 :

max s | E π [ G t : t + n | S t = s ] v π ( s ) | γ n max s | V t + n 1 ( s ) v π ( s ) |

这表明所有的n-step TD方法在合适的技术条件下都收敛到正确的预测

7.2 n-step Sarsa

跟之前介绍的Sarsa相比,只有G变成了n-step returns

G t : t + n R t + 1 + γ R t + 2 + + γ n 1 R t + n + γ n Q t + n 1 ( S t n , A t + n ) , n 1 , 0 t < T n

更新公式也基本没有发生变化
Q t + n ( S t , A t ) Q t + n 1 ( S t , A t ) + α [ G t : t + n Q t + n 1 ( S t , A t ) ] , 0 t T

The backup diagrams for the spectrum of n-step methods for state-action values
n-step Sarsa for estimating

对于上图展示的Expected Sarsa。跟n-step Sarsa类似,除了最后考虑的一项不同。

G t : t + n R t + 1 + + γ n 1 R t + n + γ n V ¯ t + n 1 ( S t + n ) , t + n < T ,

这里的不同点有 G t : t + n G t  for  t + n T
其中 V ¯ t ( s ) expected approximte value of state s
V ¯ t ( s ) a π ( a | s ) Q t ( s , a ) , for all  s 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

还是要用上 importance sampling ratio

ρ t : h k = t min ( k , T 1 ) π ( A k | S k ) b ( A k | S k )

更新公式

V t + n ( S t ) V t + n 1 ( S t ) + α ρ t : t + n 1 [ G t : t + n V t + n 1 ( S t ) ] , 0 t < T

off-policy form n-step Sarsa

Q t + n ( S t , A t ) Q t + n 1 ( S t , A t ) + α ρ t + 1 : t + n 1 [ G t : t + n Q t + n 1 ( S t , A t ) ] , 0 t < T

off-policy n-step Sarsa

7.4 *Per-decision Off-policy Methods with Control Variates

A more sophisticated approach would use per-decision importance sampling ideas

n-step returns可以写为
G t : h = R t + 1 + γ G t + 1 : h , t < h < T ,

off-policy definition of the n-step return ending at horizon

(7.13) G t : h ρ t ( R t + 1 + γ G t + 1 : h ) + ( 1 ρ t ) V h 1 ( S t ) , t < h < T ,

同时有 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

G t : h R t + 1 + γ ( ρ t + 1 G t + 1 : h + V ¯ h 1 ( S t + 1 ) ρ t + 1 Q h 1 ( S t + 1 , A t + 1 ) ) , = R t + 1 + γ ρ t + 1 ( G t + 1 : h + Q h 1 ( S t + 1 , A t + 1 ) ) + γ V ¯ h 1 ( S t + 1 ) , t < h T .

如果 h < t ,则递归以 G h : h Q h 1 ( S h , A h ) 结束;如果 h T ,则递归以 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 update

tree-backup n-step return的一般形式

G t : t + n R t + t + γ α A t + 1 π ( a | S t + 1 ) Q t + n 1 ( S t + 1 , a ) + γ π ( A t + 1 , S t + 1 ) G t + 1 : t + n , t < T 1

当n=1时, G T 1 : T R T

上述action-value用于n-step Sarsa

Q t + n ( S t , A t ) Q t + n 1 ( S t , A t ) + α [ G t : t n Q t + n 1 ( S t , A t ) ] , 0 t < T ,

n-step Tree Backup for estimating

7.6 *A Unifying Algorithm: n-step Q ( δ )

跟前面描述的类似,就是往前看的方式变了,其他的都是一样的,看下图
The backup diagrams

改写7.16的形式为如下:

G t : h = R t + 1 + γ a A t + 1 π ( a | S t + 1 ) Q h 1 ( S t + 1 , a ) + γ π ( A t + 1 | S t + 1 ) G t + 1 : h = R t + 1 + γ V ¯ h 1 ( S t + 1 ) γ π ( A t + 1 | S t + 1 ) Q h 1 ( S t + 1 , A t + 1 ) + γ π ( A t + 1 | S t + 1 ) G t + 1 : h = R t + 1 + γ π ( A t + 1 | S t + 1 ) ( G t + 1 : h Q h 1 ( S t + 1 , A t + 1 ) ) + γ V ¯ h 1 ( S t + 1 )

把其中的 π ( A t + 1 | S t + 1 ) 替换成importance-sampling ratio ρ t + 1
G t : h R t + 1 + γ ( δ t + 1 ρ t + 1 + ( 1 δ t + 1 ) π ( A t + 1 | S t + 1 ) ) ( G t + 1 : h Q h 1 ( S t + 1 , A t + 1 ) ) + γ V ¯ h 1 ( S t + 1 )

对于 t < h T ,如果 h < T ,则递归式最后以 G h : h 0 结束;如果 h = T ,则递归式最后以 G T 1 : T R T 结束。

Off-policy n-step Q(delta)

猜你喜欢

转载自blog.csdn.net/dengyibing/article/details/80623399