【ICLR2020】通過強(qiáng)化學(xué)習(xí)和稀疏獎(jiǎng)勵(lì)進(jìn)行模仿學(xué)習(xí)

  • 論文題目SQIL: Imitation Learning via Reinforcement Learning with Sparse Rewards
標(biāo)題及作者信息

所解決的問題?

??從高維的狀態(tài)動(dòng)作空間中進(jìn)行模仿學(xué)習(xí)是比較困難的,以往的行為克隆算法(behavioral cloning BC)算法容易產(chǎn)生分布漂移(distribution shift),而最近做得比較好的就是生成對抗模仿學(xué)習(xí)算法(generative adversarial imitation learning (GAIL)),是逆強(qiáng)化(Inverse RL)學(xué)習(xí)算法與生成對抗網(wǎng)絡(luò)結(jié)合的一種模仿學(xué)習(xí)算法,這個(gè)算法使用adversarial training技術(shù)學(xué)reward function,而作者提出的算法不需要reward function。整篇文章是在證明constant rewardRL方法與復(fù)雜的學(xué)習(xí)reward function的強(qiáng)化學(xué)習(xí)算法一樣有效。

??文章的主要貢獻(xiàn)在于提出了一種簡單易于實(shí)現(xiàn)版本的模仿學(xué)習(xí)算法,用于高維、連續(xù)、動(dòng)態(tài)環(huán)境中。能夠很好克服模仿學(xué)習(xí)中的distribution shift問題。

背景

??模仿學(xué)習(xí)的問題在于behavior shift,并且誤差會累計(jì),因?yàn)橹悄荏w并不知道如何回到expert的軌跡狀態(tài)上來。最近做地比較好的就是GAIL,GAIL做模仿學(xué)習(xí)最大的好處就是 encourage long-horizon imitation。那為什么GAIL能夠做到long-horizon imitation呢?模型學(xué)習(xí)一般分為兩步,在某個(gè)state下采取某個(gè)action,一般的BC算法都這么做的,而GAIL除此之外還考慮了采取這個(gè)action之后還回到expert 軌跡的下一個(gè)狀態(tài)上。而作者也采納了GAIL的上述兩點(diǎn)優(yōu)勢,但是并未使用GAIL算法中的adversarial training技術(shù),而是使用一個(gè)constant reward。如果matching the demonstrated action in a demonstrated state,reward = +1;對于其他的情況 reward =0。整個(gè)問題就變成了一個(gè)獎(jiǎng)勵(lì)稀疏的強(qiáng)化學(xué)習(xí)問題。

所采用的方法?

??作者引入soft-q-learning算法,將expert demonstrations的獎(jiǎng)勵(lì)設(shè)置為1,而與環(huán)境互動(dòng)得到的新的experiences獎(jiǎng)勵(lì)設(shè)置為0。由于soft Q-Learning算法是off-policy的算法,因此有data就可以訓(xùn)練了。整個(gè)算法作者命名為 soft Q imitation learning (SQIL)。

Soft Q Imitation Learning算法

??SQILsoft q learning算法上面做了三個(gè)小的修正:

  1. expert demonstration初始化填入agentexperience replay buffer,其reward設(shè)置為+1;
  2. agent與環(huán)境互動(dòng)得到新的data也加入到experience replay buffer里面,其reward設(shè)置為0;
  3. 平衡demonstration experiencesnew experiences50\%。這個(gè)方法在GAILadversarial IRL
    算法上面也都有應(yīng)用。

??SQIL算法如下所示:

Soft Q Imitation Learning

??其中Q_{\theta}表示的是soft q function,\mathcal{D}_{demo}demonstrations,\delta^{2}表示的是soft bellman error。Equation 1表示為:

\delta^{2}(\mathcal{D}, r) \triangleq \frac{1}{|\mathcal{D}|} \sum_{\left(s, a, s^{\prime}\right) \in \mathcal{D}}\left(Q_{\boldsymbol{\theta}}(s, a)-\left(r+\gamma \log \left(\sum_{a^{\prime} \in \mathcal{A}} \exp \left(Q_{\boldsymbol{\theta}}\left(s^{\prime}, a^{\prime}\right)\right)\right)\right)\right)^{2}

??其中獎(jiǎng)勵(lì)r只有0,1兩個(gè)取值。上述公式的理解就是希望demonstrated action能夠獲得比較高的Q值,而周圍的nearby stateaction分布就不期望那么突出,期望均勻一點(diǎn),這里就跟熵聯(lián)系起來了。

取得的效果?

實(shí)驗(yàn)結(jié)果
實(shí)驗(yàn)結(jié)果

所出版信息?作者信息?

??作者是來自加利福尼亞伯克利大學(xué)的博士生Siddharth Reddy。

Siddharth Reddy

參考鏈接

擴(kuò)展閱讀

  • Maximum entropy model of expert behavior

??Maximum entropy model of expert behaviorSQIL是基于最大熵expert behavior所得出來的算法。策略\pi服從Boltzmann distribution

\pi(a | s) \triangleq \frac{\exp (Q(s, a))}{\sum_{a^{\prime} \in \mathcal{A}} \exp \left(Q\left(s, a^{\prime}\right)\right)}

??Soft Q values可通過soft Bellman equation得到:

Q(s, a) \triangleq R(s, a)+\gamma \mathbb{E}_{s^{\prime}}\left[\log \left(\sum_{a^{\prime} \in \mathcal{A}} \exp \left(Q\left(s^{\prime}, a^{\prime}\right)\right)\right)\right]

??在我們的模仿學(xué)習(xí)設(shè)置中,rewardsdynamic是未知的,專家demonstration\mathcal{D}_{demo}是一個(gè)固定的集合。通過在environmentrolling out策略\pi 可以得到state transitions (s,a,s^{\prime}) \in \mathcal{D}_{demo}

  • Behavioral cloning (BC)

??在behavior clone中是去擬合一個(gè)參數(shù)化的model \pi_{\theta},最小化負(fù)的log-likelihood loss

\ell_{\mathrm{BC}}(\boldsymbol{\theta}) \triangleq \sum_{(s, a) \in \mathcal{D}_{d m o}}-\log \pi_{\boldsymbol{\theta}}(a | s)

??本文中作者采用的是soft q function,所以最大化的likelihood目標(biāo)方程如下所示:

\ell_{\mathrm{BC}}(\boldsymbol{\theta}) \triangleq \sum_{(s, a) \in \mathcal{D}_{\text {demo }}}-\left(Q_{\boldsymbol{\theta}}(s, a)-\log \left(\sum_{a^{\prime} \in \mathcal{A}} \exp \left(Q_{\boldsymbol{\theta}}\left(s, a^{\prime}\right)\right)\right)\right)

??從這里可以看出作者的目標(biāo)函數(shù)中相比較于行為克隆算法好處在于:后面那一項(xiàng)基于能量的式子是考慮了state transitions。

  • Regularized Behavior Clone

??SQIL可以看作是 a sparsity(稀疏) prior on the implicitly-represented rewards的行為克隆算法。

??Sparsity regularization:當(dāng)agent遇見了一個(gè)未見過的state的時(shí)候,Q_{\theta}也許會輸出任意值。(Piot et al., 2014) 等人有通過引入a sparsity prior on the implied rewards 的正則化項(xiàng)。

  • Bilal Piot, Matthieu Geist, and Olivier Pietquin. Boosted and reward-regularized classi?cation for apprenticeship learning. In Proceedings of the 2014 international conference on Autonomous agents and multi-agent systems, pp. 1249–1256. International Foundation for Autonomous Agents and Multiagent Systems, 2014.

??作者與上述這篇文章的不同點(diǎn)在于有將其應(yīng)用于連續(xù)的狀態(tài)空間,還有加了latest imitation policy進(jìn)行rollouts采樣。

??基于上文的soft Bellman equation

Q(s, a) \triangleq R(s, a)+\gamma \mathbb{E}_{s^{\prime}}\left[\log \left(\sum_{a^{\prime} \in \mathcal{A}} \exp \left(Q\left(s^{\prime}, a^{\prime}\right)\right)\right)\right]

??我們可以得到reward的表達(dá)式子:

R_{q}(s, a) \triangleq Q_{\boldsymbol{\theta}}(s, a)-\gamma \mathbb{E}_{s^{\prime}}\left[\log \left(\sum_{a^{\prime} \in \mathcal{A}} \exp \left(Q_{\boldsymbol{\theta}}\left(s^{\prime}, a^{\prime}\right)\right)\right)\right]

??從中也可以發(fā)現(xiàn)其會考慮下一個(gè)狀態(tài)s^{\prime},而不像BC那樣只maximization action likelihood。最終的Regularized BC算法可表示為:

\ell_{\mathrm{RBC}}(\boldsymbol{\theta}) \triangleq \ell_{\mathrm{BC}}(\boldsymbol{\theta})+\lambda \delta^{2}\left(\mathcal{D}_{\text {demo }} \cup \mathcal{D}_{\mathrm{samp}}, 0\right)

??其中\lambda是超參數(shù),\delta^{2}soft bellman error的平方??梢钥闯?code>RBC算法與SQIL有異曲同工之妙。

  • Connection Between SQIL and Regularized Behavioral Clone

\nabla_{\boldsymbol{\theta}} \ell_{\mathrm{RBC}}(\boldsymbol{\theta}) \propto \nabla_{\boldsymbol{\theta}}\left(\delta^{2}\left(\mathcal{D}_{\text {demo }}, 1\right)+\lambda_{\text {samp }} \delta^{2}\left(\mathcal{D}_{\text {samp }}, 0\right)+V\left(s_{0}\right)\right)

??SQIL相比與RBC算法引入了+10reward,相當(dāng)于是加強(qiáng)了獎(jiǎng)勵(lì)稀疏的先驗(yàn)知識

我的微信公眾號名稱:深度學(xué)習(xí)先進(jìn)智能決策
微信公眾號ID:MultiAgent1024
公眾號介紹:主要研究深度學(xué)習(xí)、強(qiáng)化學(xué)習(xí)、機(jī)器博弈等相關(guān)內(nèi)容!期待您的關(guān)注,歡迎一起學(xué)習(xí)交流進(jìn)步!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容