【5分钟 Paper】(TD3) Addressing Function Approximation Error in Actor-Critic Methods
文章目录
- 所解决的问题?
- 背景
- 所采用的方法?
- 前人算法回顾
- Clipped Double Q-Learning
- Addressing Variance
- Target Policy Smoothing Regularization
- 算法伪代码:
- 取得的效果?
- 所出版信息?作者信息?
- 扩展阅读
- 论文题目:Addressing Function Approximation Error in Actor-Critic Methods
所解决的问题?
value-base
的强化学习值函数的近似估计会过估计值函数(DQN
),作者将Double Q-Learning
处理过拟合的思想引入actor critic
算法中。(过估计的问题就在于累计误差会使得某些不好的state
的value
变地很高(exploration
不充分所导致的))。还花了很大的心血在处理过估计问题修正后带来的方差过高的问题。
作者将过估计的问题引入到continuous action space
中,在continuous action space
中处理过估计问题的难点在于policy
的change
非常缓慢,导致current
和target
的value
差距不大, too similar to avoid maximization bias。
背景
以往的算法解决过估计问题的就是Double Q Learning
那一套,但是这种方法虽然说会降低bias
但是会引入高的variance
(在选择下一个时刻s‘
的action
的时候,不确定性变得更大才将以往DQN
中max
这一步变得不是那么max
,与之带来的问题就是方差会变大),仍然会对policy
的优化起负面作用。作者是用clipped double q learning
来解决这个问题。
所采用的方法?
作者所采用的很多components
用于减少方差:
DQN
中的target network
用于variance reduction by reducing the accumulation of errors(不使用target network
的使用是振荡更新的)。- 为了解决
value
和policy
耦合的关系,提出了延迟更新(delaying policy updates
)的方式。(to address the coupling of value and policy, we propose delaying policy updates until the value estimate has converged) - 提出了
novel regularization
的更新方式SARSA-style
( the variance reduction by averaging over valueestimates)。这种方法参考的是18
年Nachum
的将值函数smooth
能够减少方差的算法。
- Nachum, O., Norouzi, M., Tucker, G., and Schuurmans, D. Smoothed action value functions for learning gaussian policies. arXiv preprint arXiv:1803.02348, 2018.
当然multi-step return
也能够去权衡方差与偏差之间的关系,还有一些放在文末扩展阅读里面了。
作者将上述修正方法用于Deep Deterministic Policy Gradient
算法中并将其命名为Twin Delayed Deep Deterministic policy gradient (TD3
)算法中。一种考虑了在policy
和value
函数近似过程中所带来的一些误差对AC
框架所带来的影响。
前人算法回顾
首先回顾一下DPG
算法的更新公式:
∇ϕJ(ϕ)=Es∼pπ[∇aQπ(s,a)∣a=π(s)∇ϕπϕ(s)]\nabla_{\phi} J(\phi)=\mathbb{E}_{s \sim p_{\pi}}\left[\left.\nabla_{a} Q^{\pi}(s, a)\right|_{a=\pi(s)} \nabla_{\phi} \pi_{\phi}(s)\right] ∇ϕJ(ϕ)=Es∼pπ[∇aQπ(s,a)∣a=π(s)∇ϕπϕ(s)]
其中 Qπ(s,a)=r+γEs′,a′[Qπ(s′,a′)]Q^{\pi}(s,a) = r+\gamma \mathbb{E}_{s^{\prime},a^{\prime}}[Q^{\pi}(s^{\prime},a^{\prime})]Qπ(s,a)=r+γEs′,a′[Qπ(s′,a′)],Qπ(s,a)Q^{\pi}(s,a)Qπ(s,a)可以用参数 θ\thetaθ 近似,在DQN
中还使用了frozen target network
Qθ′(s,a)Q_{\theta^{\prime}}(s,a)Qθ′(s,a),更新的目标为:
y=r+γQθ′(s′,a′),a′∼πϕ′(s′)y=r+\gamma Q_{\theta^{\prime}}\left(s^{\prime}, a^{\prime}\right), \quad a^{\prime} \sim \pi_{\phi^{\prime}}\left(s^{\prime}\right) y=r+γQθ′(s′,a′),a′∼πϕ′(s′)
如果受误差ε\varepsilonε 干扰,则有:
Eε[maxa′(Q(s′,a′)+ε)]≥maxa′Q(s′,a′)\mathbb{E}_{\varepsilon}[\max_{a^{\prime}}(Q(s^{\prime},a^{\prime})+\varepsilon)] \geq \max_{a^{\prime}}Q(s^{\prime},a^{\prime}) Eε[a′max(Q(s′,a′)+ε)]≥a′maxQ(s′,a′)
在AC
框架下,用ϕapprox\phi_{approx}ϕapprox表示actor
能获得近似值函数Qθ(s,a)Q_{\theta}(s,a)Qθ(s,a)的近似策略参数(Qθ(s,a)Q_{\theta}(s,a)Qθ(s,a)所对应的那个策略参数),ϕtrue\phi_{true}ϕtrue表示actor能获得真实准确Qπ(s,a)Q^{\pi}(s,a)Qπ(s,a)的参数(which is not known during learning)。
ϕapprox =ϕ+αZ1Es∼pπ[∇ϕπϕ(s)∇aQθ(s,a)∣a=πϕ(s)]ϕtrue =ϕ+αZ2Es∼pπ[∇ϕπϕ(s)∇aQπ(s,a)∣a=πϕ(s)]\begin{aligned} \phi_{\text {approx }} &=\phi+\frac{\alpha}{Z_{1}} \mathbb{E}_{s \sim p_{\pi}}[\nabla_{\phi} \pi_{\phi}(s) \nabla_{a} Q_{\theta}(s, a)|_{a=\pi_{\phi} (s)}]\\ \phi_{\text {true }} &=\phi+\frac{\alpha}{Z_{2}} \mathbb{E}_{s \sim p_{\pi}}[\nabla_{\phi} \pi_{\phi}(s) \nabla_{a} Q^{\pi}(s, a)|_{a=\pi_{\phi} (s)}] \end{aligned} ϕapprox ϕtrue =ϕ+Z1αEs∼pπ[∇ϕπϕ(s)∇aQθ(s,a)∣a=πϕ(s)]=ϕ+Z2αEs∼pπ[∇ϕπϕ(s)∇aQπ(s,a)∣a=πϕ(s)]
其中 Z1Z_{1}Z1,Z2Z_{2}Z2 是梯度归一化参数,有 Z−1∣∣E[⋅]∣∣=1Z^{-1}||\mathbb{E[\cdot]}|| =1Z−1∣∣E[⋅]∣∣=1。这里做归一化的原因就是更容易保证收敛(Without normalized gradients, overestimation bias is still guaranteed to occur with slightly stricter conditions. )。
由于梯度方向是局部最大化的方向,存在一个足够小的 ε1\varepsilon_{1}ε1,使得α≤ε1\alpha \leq \varepsilon_{1}α≤ε1时approximate value
of πapprox\pi_{approx}πapprox 会有一个下界 approximate value of
πtrue\pi_{true}πtrue(approximate
会存在过估计问题,就是下面这个式子所描述的)。
E[Qθ(s,πapprox(s))]≥E[Qθ(s,πtrue(s))]\mathbb{E}[Q_{\theta}(s,\pi_{approx}(s))] \geq \mathbb{E}[Q_{\theta}(s,\pi_{true}(s))] E[Qθ(s,πapprox(s))]≥E[Qθ(s,πtrue(s))]
相反的,存在一个足够小的 ε2\varepsilon_{2}ε2 使得 α≤ε2\alpha \leq \varepsilon_{2}α≤ε2时,the true value of
πapprox\pi_{approx}πapprox 会有一个上界 the true value of
πtrue\pi_{true}πtrue (approximate policy
所得出来的动作在真实的action value function
中无法达到最优):
E[Qπ(s,πtrue(s))]≥E[Qπ(s,πapprox(s))]\mathbb{E}[Q^{\pi}(s,\pi_{true}(s))] \geq \mathbb{E}[Q^{\pi}(s,\pi_{approx}(s))] E[Qπ(s,πtrue(s))]≥E[Qπ(s,πapprox(s))]
the value estimate
会大于等于true value
E[Qθ(s,πtrue(s))]≥E[Qπ(s,πtrue(s))]\mathbb{E}[Q_{\theta}(s,\pi_{true}(s))] \geq \mathbb{E}[Q^{\pi}(s,\pi_{true}(s))]E[Qθ(s,πtrue(s))]≥E[Qπ(s,πtrue(s))],三式联立有:
E[Qθ(s,πapprox(s))]≥E[Qπ(s,πapprox(s))]\mathbb{E}[Q_{\theta}(s,\pi_{approx}(s))] \geq \mathbb{E}[Q^{\pi}(s,\pi_{approx}(s))] E[Qθ(s,πapprox(s))]≥E[Qπ(s,πapprox(s))]
Clipped Double Q-Learning
Double DQN
中的target
:
y=r+γQθ′(s′,πϕ(s′))y = r + \gamma Q_{\theta^{\prime}}(s^{\prime},\pi_{\phi}(s^{\prime})) y=r+γQθ′(s′,πϕ(s′))
Double Q-learning
:
y1=r+γQθ2′(s′,πϕ1(s′))y2=r+γQθ1′(s′,πϕ2(s′))\begin{array}{l} y_{1}=r+\gamma Q_{\theta_{2}^{\prime}}\left(s^{\prime}, \pi_{\phi_{1}}\left(s^{\prime}\right)\right) \\ y_{2}=r+\gamma Q_{\theta_{1}^{\prime}}\left(s^{\prime}, \pi_{\phi_{2}}\left(s^{\prime}\right)\right) \end{array} y1=r+γQθ2′(s′,πϕ1(s′))y2=r+γQθ1′(s′,πϕ2(s′))
Clipped Double Q-learning
:
y1=r+γmini=1,2Qθi′(s′,πϕ1(s′))y_{1} = r + \gamma \min_{i=1,2}Q_{\theta_{i}^{\prime}}(s^{\prime},\pi_{\phi_{1}}(s^{\prime})) y1=r+γi=1,2minQθi′(s′,πϕ1(s′))
这里的ϕ1\phi_{1}ϕ1指的是target actor
(可参见伪代码,只用了一个actor
)。这种方法会underestimation bias
,由于underestimation bias
这种方法就需要加大探索度,不然算法的效率就会很低。
如果 Qθ2>Qθ1Q_{\theta_{2}} > Q_{\theta_{1}}Qθ2>Qθ1,那么就相当于辅助的Qθ2Q_{\theta_{2}}Qθ2没用到,那么就no additional bias
;如果 Qθ1>Qθ2Q_{\theta_{1}} > Q_{\theta_{2}}Qθ1>Qθ2那么就会取到Qθ2Q_{\theta_{2}}Qθ2,作者原文附录里面有证明收敛性。
Addressing Variance
设置target network
用于减小policy
更新所带的的方差,不然state value approx
会很容易发散,不收敛。
作者使用policy
相比于value
做延迟更新(Delayed Policy Updates),这样保证策略更新的时候,先将TD
误差最小化,这样不会使得policy
更新的时候受误差影响,导致其方差高。
Target Policy Smoothing Regularization
作者认为similar actions should have similar value
,所以对某个action
周围加上少许噪声能够使得模型泛化能力更强。
y=r+γQθ′(s′,πϕ′(s′)+ϵ)ϵ∼clip(N(0,σ),−c,c)\begin{aligned} y &=r+\gamma Q_{\theta^{\prime}}\left(s^{\prime}, \pi_{\phi^{\prime}}\left(s^{\prime}\right)+\epsilon\right) \\ \epsilon & \sim \operatorname{clip}(\mathcal{N}(0, \sigma),-c, c) \end{aligned} yϵ=r+γQθ′(s′,πϕ′(s′)+ϵ)∼clip(N(0,σ),−c,c)
相似的想法在Nachum et al.(2018)上也有设计,不过是smoothing QθQ_{\theta}Qθ,不是Qθ′Q_{\theta^{\prime}}Qθ′。
- Nachum, O., Norouzi, M., Tucker, G., and Schuurmans, D. Smoothed action value functions for learning gaussian policies. arXiv preprint arXiv:1803.02348, 2018.
算法伪代码:
取得的效果?
作者与当前的sota
算法对比,结果如下:
作者还验证了target neteork
对收敛性的影响:
最终的实验:
所出版信息?作者信息?
ICML2018
上的一篇文章,Scott Fujimoto
is a PhD student at McGill University and Mila. He is the author of TD3 as well as some of the recent developments in batch deep reinforcement learning.
他还有俩篇论文比较有意思:Off-Policy Deep Reinforcement Learning without Exploration
;Benchmarking Batch Deep Reinforcement Learning Algorithms
。
扩展阅读
- 论文代码:https://github.com/sfujim/TD3
作者为了验证论文的复现性,参考了2017
年Henderson, P
的文章实验了很多随机种子。
- 参考文献:Henderson, P., Islam, R., Bachman, P., Pineau, J., Precup, D., and Meger, D. Deep Reinforcement Learning that Matters. arXiv preprint arXiv:1709.06560, 2017
还有一些平衡bias
和variance
的方法,比如:
- importance sampling
- Precup, D., Sutton, R. S., and Dasgupta, S. Off-policy temporal-difference learning with function approximation. In International Conference on Machine Learning, pp. 417–424, 2001.
- Munos, R., Stepleton, T., Harutyunyan, A., and Bellemare, M. Safe and efficient off-policy reinforcement learning. In Advances in Neural Information Processing Systems, pp. 1054–1062, 2016.
- distributed methods
- Mnih, V., Badia, A. P., Mirza, M., Graves, A., Lillicrap, T., Harley, T., Silver, D., and Kavukcuoglu, K. Asynchronous methods for deep reinforcement learning. In Internationa lConference on Machine Learning, pp.1928– 1937, 2016.
- Espeholt, L., Soyer, H., Munos, R., Simonyan, K., Mnih, V., Ward, T., Doron, Y., Firoiu, V., Harley, T., Dunning, I., et al. Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures. arXiv preprint arXiv:1802.01561, 2018.
- approximate bounds
- He, F. S., Liu, Y., Schwing, A. G., and Peng, J. Learning to play in a day: Faster deep reinforcement learning by optimality tightening. arXiv preprint arXiv:1611.01606, 2016.
- reduce discount factor to reduce the contribution of each error
- Petrik, M. and Scherrer, B. Biasing approximate dynamic programming with a lower discount factor. In Advancesin Neural Information Processing Systems, pp. 1265–1272, 2009.
我的微信公众号名称:深度学习与先进智能决策
微信公众号ID:MultiAgent1024
公众号介绍:主要研究分享深度学习、机器博弈、强化学习等相关内容!期待您的关注,欢迎一起学习交流进步!
【5分钟 Paper】(TD3) Addressing Function Approximation Error in Actor-Critic Methods相关推荐
- Addressing Function Approximation Error in Actor-Critic Methods
Abstract 在基于价值的RL方法(例如深度Q学习)中,已知函数近似误差会导致高价值估计和次优策略.我们表明,这个问题在actor-critic设置中仍然存在,并提出了新颖的机制以最小化它对act ...
- 值函数近似Value Function Approximation
1.Introduction 值函数有两种:状态值函数V(s)和动作状态值函数Q(s,a).对于大规模MDP问题,有很多state或者action需要存储,单个学习每种状态的价值非常慢,因此使用函数逼 ...
- 论文解读 Greedy Function Approximation:A Gradient Boosting Machine
论文链接: https://xueshu.baidu.com/usercenter/paper/show?paperid=ab7165108163edc94b30781e51819e0c Abstra ...
- 小程序报错:Error: errCode: -404011 cloud function execution error | errMsg: cloud.callFunction:fail req..
小程序报错 addFunction.js? [sm]:55 [云函数] [sum] 调用失败: Error: errCode: -404011 cloud function execution err ...
- 小程序云开发中的一些注意点与Error: errCode: -404011 cloud function execution error | errMsg: clou----错误
小程序云开发注意点 1兼容性问题, 1.1版本在2.2.3以上 1.2或在app.json/game.json中增加"cloud":true 云开发初始化: app.js中 wx. ...
- Value function approximation
前面的一篇博客:Model-free control:如何从经验中学习一个好的策略 到目前为止,我们都假设了可以将价值函数或state-action价值(即Q函数)表示成向量或者矩阵 表格表示法 很多 ...
- 强化学习笔记(三)Value Function Approximation
目录 学习考察 引言 1.值函数近似(VFA) 2.什么是oracle? 如果没有oracle,我们如何优化价值拟合函数呢? 3.蒙特卡洛值函数近似(MC-VFA) 4.时序差分函数近似(TD-VFA ...
- Paper:《Graph Neural Networks: A Review of Methods and Applications》翻译与解读
Paper:<Graph Neural Networks: A Review of Methods and Applications>翻译与解读 目录 <Graph Neural N ...
- Paper:《Graph Neural Networks: A Review of Methods and Applications—图神经网络:方法与应用综述》翻译与解读
Paper:<Graph Neural Networks: A Review of Methods and Applications-图神经网络:方法与应用综述>翻译与解读 目录 < ...
- 解决TortoiseGitPlink Fatal Error - No supported authentication methods available
TortoiseGitPlink Fatal Error - No supported authentication methods available (server sent: publickey ...
最新文章
- 网站内容才是SEO的第一要素
- Elasticsearch Java 操作client
- android tv 蓝牙服务_打电话、看电话,听清大千世界,不单只有助听器,力斯顿的尖端配件“无线通”“TV伴侣”了解一下。...
- Linux lua 性能,systemTab动态分析linux下lua性能
- FFmpeg4.3.2之ffplay log输出级别(三十)
- 关于审核被拒申诉那点事
- IntelliJ IDEA使用技巧(三)——Debug 篇
- RapidMiner 数据读写
- Counting Stars 全中国最准确的翻译!
- linux串行提交脚本,如何保证shell脚本串行执行
- 3Dmax专用快捷键大全(保姆式手把手教)
- hashCode()和哈希值
- 界面美化 —— 布局
- VB生成二维码图形的控件,CSDN利用盗版卖卖会员44积分赚钱
- 美国计算机科学专业申请条件,美国CS计算机科学专业申请条件有哪些?
- python基础教程目录,从入门到上手的
- 2019-06-17问答系统项目落地调研
- i7 1255u和i5 1135G7哪个好
- JMETER解决测试结果乱码问题
- 硬件知识:如何快速挑选一款好的固态硬盘?
热门文章
- MySQL不区分大小写(Linux与WINDOWS)
- strstr 可以用来查找子字符串的位置
- 计算机网络数据链路层之使用点对点信道
- MPLS virtual private network OptionB实验(华为设备)
- 运维之Linux秋招重点(根据面经和常见笔试题总结,持续更新)
- 杭电计算机2010年笔试真题详解
- HDOJ--1598--find the most comfortable road(并查集+枚举)
- 基础算法:与、或、异或运算
- hdu 2528:Area(计算几何,求线段与直线交点 + 求多边形面积)
- mvcframeworkProgramming ASP.NET MVC-Fundamentals of ASP.NET MVC(四)Controller