Generative Adversarial Imitation Learning | AGIDaily
AGI Daily
资讯日报词条论文人物新创
返回论文列表
摘要1 引言2 背景预备逆强化学习3 刻画诱导出的最优策略命题 3.1(Syed 等人 2008 定理 2)。命题 3.2。推论 3.2.1。引理 3.1。引理 3.2。推论 3.2.1 的证明。4 实用的占用测度匹配熵正则的学徒学习学徒学习的缺点学徒学习的优点5 生成对抗模仿学习算法6 实验7 讨论与展望致谢参考文献附录 A 证明A.1 第 3 节的证明引理 3.1 的证明。命题 3.2 的证明。A.2 第 5 节的证明命题 A.1。证明。推论 A.1.1。证明。引理 A.1。证明。附录 B 环境与详细结果
返回论文列表
目录

Generative Adversarial Imitation Learning

收录于 NeurIPS 2016;会议论文被引 2,023 次
打开论文来源

Generative Adversarial Imitation Learning

Jonathan Ho Affiliation:  Stanford University Email:  hoj@cs.stanford.edu    Stefano Ermon Affiliation:  Stanford University Email:  ermon@cs.stanford.edu

Abstract

摘要

Consider learning a policy from example expert behavior, without interaction with the expert or access to reinforcement signal. One approach is to recover the expert’s cost function with inverse reinforcement learning, then extract a policy from that cost function with reinforcement learning. This approach is indirect and can be slow. We propose a new general framework for directly extracting a policy from data, as if it were obtained by reinforcement learning following inverse reinforcement learning. We show that a certain instantiation of our framework draws an analogy between imitation learning and generative adversarial networks, from which we derive a model-free imitation learning algorithm that obtains significant performance gains over existing model-free methods in imitating complex behaviors in large, high-dimensional environments.

考虑从示例专家行为中学习策略,且训练时既不与专家交互、也拿不到强化信号。一条路子是用逆强化学习先恢复专家的代价函数,再用强化学习从该代价抽出策略。这条路间接,而且往往很慢。我们提出一个一般框架,直接从数据抽出策略,效果上就像先做了逆强化学习再跑强化学习。我们证明框架的某一实例把模仿学习与生成对抗网络对应起来,由此得到一种无模型模仿学习算法;在大型高维环境中模仿复杂行为时,它相对已有无模型方法有显著性能提升。

1 Introduction

1 引言

We are interested in a specific setting of imitation learning—the problem of learning to perform a task from expert demonstrations—in which the learner is given only samples of trajectories from the expert, is not allowed to query the expert for more data while training, and is not provided reinforcement signal of any kind. There are two main approaches suitable for this setting: behavioral cloning [20], which learns a policy as a supervised learning problem over state-action pairs from expert trajectories; and inverse reinforcement learning [25, 18], which finds a cost function under which the expert is uniquely optimal.

我们关心模仿学习的一种具体设定——从专家演示中学会完成任务:学习者只拿到专家轨迹样本,训练期间不能再向专家查询数据,也得不到任何形式的强化信号。适合这一设定的两条主路线是:行为克隆(behavioral cloning)[20],把专家轨迹中的状态–动作对当成监督学习问题来拟合策略;以及逆强化学习(inverse reinforcement learning)[25, 18],寻找使专家策略唯一最优的代价函数。

Behavioral cloning, while appealingly simple, only tends to succeed with large amounts of data, due to compounding error caused by covariate shift [23, 24]. Inverse reinforcement learning (IRL), on the other hand, learns a cost function that prioritizes entire trajectories over others, so compounding error, a problem for methods that fit single-timestep decisions, is not an issue. Accordingly, IRL has succeeded in a wide range of problems, from predicting behaviors of taxi drivers [31] to planning footsteps for quadruped robots [22].

行为克隆看似简单,却往往需要大量数据才能成功,原因是协变量偏移带来的误差累积 [23, 24]。逆强化学习(IRL)则学习一种对整条轨迹排序的代价函数,因此不会像「按单步决策拟合」的方法那样吃累积误差的亏。相应地,IRL 已在从预测出租车司机行为 [31] 到为四足机器人规划落脚点 [22] 等广泛问题上取得成功。

Unfortunately, many IRL algorithms are extremely expensive to run, requiring reinforcement learning in an inner loop. Scaling IRL methods to large environments has thus been the focus of much recent work [7, 14]. Fundamentally, however, IRL learns a cost function, which explains expert behavior but does not directly tell the learner how to act. Given that learner’s true goal often is to take actions imitating the expert—indeed, many IRL algorithms are evaluated on the quality of the optimal actions of the costs they learn—why, then, must we learn a cost function, if doing so possibly incurs significant computational expense yet fails to directly yield actions?

遗憾的是,许多 IRL 算法运行代价极高,内层还要再跑强化学习。于是把 IRL 扩到大环境成了近期工作的焦点 [7, 14]。但从根本上说,IRL 学到的是代价函数:它解释专家行为,却不直接告诉学习者该怎么动。既然学习者的真实目标常常就是做出像专家那样的动作——事实上许多 IRL 算法正是用所学代价下的最优动作质量来评估的——那为什么还非要先学一个代价函数?这样做可能既贵,又不能直接给出动作。

We desire an algorithm that tells us explicitly how to act by directly learning a policy. To develop such an algorithm, we begin in Section 3, where we characterize the policy given by running reinforcement learning on a cost function learned by maximum causal entropy IRL [31, 32]. Our characterization introduces a framework for directly learning policies from data, bypassing any intermediate IRL step.

我们希望有一种算法,通过直接学习策略,明确告诉我们该怎么行动。为此,第 3 节先刻画:对最大因果熵 IRL [31, 32] 学到的代价再跑强化学习,得到的是怎样的策略。这一刻画引出一个直接从数据学策略的框架,绕开中间的 IRL 步骤。

Then, we instantiate our framework in Sections 4 and 5 with a new model-free imitation learning algorithm. We show that our resulting algorithm is intimately connected to generative adversarial networks [9], a technique from the deep learning community that has led to recent successes in modeling distributions of natural images: our algorithm harnesses generative adversarial training to fit distributions of states and actions defining expert behavior. We test our algorithm in Section 6, where we find that it outperforms competing methods by a wide margin in training policies for complex, high-dimensional physics-based control tasks over various amounts of expert data.

随后在第 4、5 节把该框架实例化成一种新的无模型模仿学习算法。我们证明所得算法与生成对抗网络 [9] 密切相关——后者是深度学习社区用来建模自然图像分布、并带来近期成功的技术:我们的算法借助生成对抗训练,去拟合刻画专家行为的状态–动作分布。第 6 节的实验表明,在多种专家数据量下,它为复杂、高维、基于物理的控制任务训练策略时,大幅优于对照方法。

2 Background

2 背景

Preliminaries

R‾\overline{\mathbb{R}}R will denote the extended real numbers R∪{∞}\mathbb{R}\cup\{\infty\}R∪{∞}. Section 3 will work with finite state and action spaces S\mathcal{S}S and A\mathcal{A}A to avoid technical machinery out of the scope of this paper (concerning compactness of certain sets of functions), but our algorithms and experiments later in the paper will run in high-dimensional continuous environments. Π\PiΠ is the set of all stationary stochastic policies that take actions in A\mathcal{A}A given states in S\mathcal{S}S; successor states are drawn from the dynamics model P(s′∣s,a)P(s^{\prime}|s,a)P(s′∣s,a). We work in the γ\gammaγ-discounted infinite horizon setting, and we will use an expectation with respect a policy π∈Π\pi\in\Piπ∈Π to denote an expectation with respect to the trajectory it generates: Eπ[c(s,a)]≜E[∑t=0∞γtc(st,at)]\mathbb{E}_{\pi}[c(s,a)]\triangleq\mathbb{E}\left[\sum_{t=0}^{\infty}\gamma^{t}c(s_{t},a_{t})\right]Eπ​[c(s,a)]≜E[∑t=0∞​γtc(st​,at​)], where s0∼p0s_{0}\sim p_{0}s0​∼p0​, at∼π(⋅∣st)a_{t}\sim\pi(\cdot|s_{t})at​∼π(⋅∣st​), and st+1∼P(⋅∣st,at)s_{t+1}\sim P(\cdot|s_{t},a_{t})st+1​∼P(⋅∣st​,at​) for t≥0t\geq 0t≥0. We will use ^Eτ\hat{}\mathbb{E}_{\tau}^Eτ​ to denote empirical expectation with respect to trajectory samples τ\tauτ, and we will always refer to the expert policy as πE\pi_{E}πE​.

预备

R‾\overline{\mathbb{R}}R 表示扩展实数 R∪{∞}\mathbb{R}\cup\{\infty\}R∪{∞}。第 3 节为避开超出本文范围的技术细节(某些函数集的紧性),只讨论有限状态与动作空间 S\mathcal{S}S、A\mathcal{A}A;后文算法与实验则会在高维连续环境中运行。Π\PiΠ 是给定 S\mathcal{S}S 中状态、在 A\mathcal{A}A 中取动作的全体平稳随机策略;下一状态由动力学模型 P(s′∣s,a)P(s^{\prime}|s,a)P(s′∣s,a) 抽样。我们工作在 γ\gammaγ-折扣无限时域设定下,对策略 π∈Π\pi\in\Piπ∈Π 的期望表示对其生成轨迹的期望:Eπ[c(s,a)]≜E[∑t=0∞γtc(st,at)]\mathbb{E}_{\pi}[c(s,a)]\triangleq\mathbb{E}\left[\sum_{t=0}^{\infty}\gamma^{t}c(s_{t},a_{t})\right]Eπ​[c(s,a)]≜E[∑t=0∞​γtc(st​,at​)],其中 s0∼p0s_{0}\sim p_{0}s0​∼p0​,at∼π(⋅∣st)a_{t}\sim\pi(\cdot|s_{t})at​∼π(⋅∣st​),st+1∼P(⋅∣st,at)s_{t+1}\sim P(\cdot|s_{t},a_{t})st+1​∼P(⋅∣st​,at​)(t≥0t\geq 0t≥0)。^Eτ\hat{}\mathbb{E}_{\tau}^Eτ​ 表示对轨迹样本 τ\tauτ 的经验期望;专家策略一律记为 πE\pi_{E}πE​。

Inverse reinforcement learning

Suppose we are given an expert policy πE\pi_{E}πE​ that we wish to rationalize with IRL. For the remainder of this paper, we will adopt maximum causal entropy IRL [31, 32], which fits a cost function from a family of functions C\mathcal{C}C with the optimization problem

逆强化学习

假设给定专家策略 πE\pi_{E}πE​,要用 IRL 加以合理化。本文后文一律采用最大因果熵 IRL [31, 32],它从函数族 C\mathcal{C}C 中拟合代价函数,优化问题为

\maximizec∈C(min⁡π∈Π−H(π)+Eπ[c(s,a)])−EπE[c(s,a)](1)\displaystyle\maximize_{c\in\mathcal{C}}\left(\min_{\pi\in\Pi}-H(\pi)+\mathbb{E}_{\pi}[c(s,a)]\right)-\mathbb{E}_{\pi_{E}}[c(s,a)] \tag{1}\maximizec∈C​(π∈Πmin​−H(π)+Eπ​[c(s,a)])−EπE​​[c(s,a)](1)

where H(π)≜Eπ[−log⁡π(a∣s)]H(\pi)\triangleq\mathbb{E}_{\pi}[-\log\pi(a|s)]H(π)≜Eπ​[−logπ(a∣s)] is the γ\gammaγ-discounted causal entropy [3] of the policy π\piπ. In practice, πE\pi_{E}πE​ will only be provided as a set of trajectories sampled by executing πE\pi_{E}πE​ in the environment, so the expected cost of πE\pi_{E}πE​ in Eq. 1 is estimated using these samples. Maximum causal entropy IRL looks for a cost function c∈Cc\in\mathcal{C}c∈C that assigns low cost to the expert policy and high cost to other policies, thereby allowing the expert policy to be found via a certain reinforcement learning procedure:

其中 H(π)≜Eπ[−log⁡π(a∣s)]H(\pi)\triangleq\mathbb{E}_{\pi}[-\log\pi(a|s)]H(π)≜Eπ​[−logπ(a∣s)] 是策略 π\piπ 的 γ\gammaγ-折扣因果熵 [3]。实践中 πE\pi_{E}πE​ 只以在环境中执行 πE\pi_{E}πE​ 得到的轨迹集合形式给出,因而式 (1) 中 πE\pi_{E}πE​ 的期望代价要用这些样本估计。最大因果熵 IRL 寻找 c∈Cc\in\mathcal{C}c∈C,给专家策略低代价、给其他策略高代价,从而专家策略可通过下述强化学习过程找回:

\rl(c)=arg min⁡π∈Π−H(π)+Eπ[c(s,a)](2)\displaystyle\rl(c)=\argmin_{\pi\in\Pi}-H(\pi)+\mathbb{E}_{\pi}[c(s,a)] \tag{2}\rl(c)=π∈Πargmin​−H(π)+Eπ​[c(s,a)](2)

which maps a cost function to high-entropy policies that minimize the expected cumulative cost.

它把代价函数映射到期望累积代价最小的高熵策略。

3 Characterizing the induced optimal policy

3 刻画诱导出的最优策略

To begin our search for an imitation learning algorithm that both bypasses an intermediate IRL step and is suitable for large environments, we will study policies found by reinforcement learning on costs learned by IRL on the largest possible set of cost functions C\mathcal{C}C in Eq. 1: all functions RS×A={c:S×A→R}\mathbb{R}^{\mathcal{S}\times\mathcal{A}}=\{c:\mathcal{S}\times\mathcal{A}\rightarrow\mathbb{R}\}RS×A={c:S×A→R}. Using expressive cost function classes, like Gaussian processes [15] and neural networks [7], is crucial to properly explain complex expert behavior without meticulously hand-crafted features. Here, we investigate the best IRL can do with respect to expressiveness, by examining its capabilities with C=RS×A\mathcal{C}=\mathbb{R}^{\mathcal{S}\times\mathcal{A}}C=RS×A.

为寻找既绕开中间 IRL、又适合大环境的模仿学习算法,我们先研究:在式 (1) 最大可能的代价函数类 C\mathcal{C}C——即全体函数 RS×A={c:S×A→R}\mathbb{R}^{\mathcal{S}\times\mathcal{A}}=\{c:\mathcal{S}\times\mathcal{A}\rightarrow\mathbb{R}\}RS×A={c:S×A→R}——上做 IRL,再对学到的代价跑强化学习,会得到什么策略。要用高斯过程 [15]、神经网络 [7] 这类有表达力的代价类,才能在不精心手工特征的情况下解释复杂专家行为。这里我们考察 IRL 在表达力上的「最好能做什么」,即取 C=RS×A\mathcal{C}=\mathbb{R}^{\mathcal{S}\times\mathcal{A}}C=RS×A。

Of course, with such a large C\mathcal{C}C, IRL can easily overfit when provided a finite dataset. Therefore, we will incorporate a (closed, proper) convex cost function regularizer ψ:RS×A→R‾\psi:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}ψ:RS×A→R into our study. Note that convexity is a not particularly restrictive requirement: ψ\psiψ must be convex as a function defined on all of RS×A\mathbb{R}^{\mathcal{S}\times\mathcal{A}}RS×A, not as a function defined on a small parameter space; indeed, the cost regularizers of Finn et al. 2016, effective for a range of robotic manipulation tasks, satisfy this requirement. Interestingly, will in fact find that ψ\psiψ plays a central role in our discussion, not a nuisance in our analysis.

当然,如此大的 C\mathcal{C}C 在有限数据上很容易过拟合。因此我们引入一个(闭的、固有的)凸代价正则项 ψ:RS×A→R‾\psi:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}ψ:RS×A→R。凸性并不是特别苛刻的要求:ψ\psiψ 须作为定义在整个 RS×A\mathbb{R}^{\mathcal{S}\times\mathcal{A}}RS×A 上的函数是凸的,而不是定义在小小参数空间上的函数;Finn 等人 2016 年对一系列机器人操作任务有效的代价正则项就满足这一点。有意思的是,ψ\psiψ 在后文讨论中会扮演中心角色,而不是分析里的累赘。

Now, let us define an IRL primitive procedure, which finds a cost function such that the expert performs better than all other policies, with the cost regularized by ψ\psiψ:

现在定义一个 IRL 原语:在 ψ\psiψ 正则下,寻找使专家优于所有其他策略的代价函数:

\irlψ(πE)=arg max⁡c∈RS×A−ψ(c)+(min⁡π∈Π−H(π)+Eπ[c(s,a)])−EπE[c(s,a)](3)\displaystyle\irl_{\psi}(\pi_{E})=\argmax_{c\in\mathbb{R}^{\mathcal{S}\times\mathcal{A}}}-\psi(c)+\left(\min_{\pi\in\Pi}-H(\pi)+\mathbb{E}_{\pi}[c(s,a)]\right)-\mathbb{E}_{\pi_{E}}[c(s,a)] \tag{3}\irlψ​(πE​)=c∈RS×Aargmax​−ψ(c)+(π∈Πmin​−H(π)+Eπ​[c(s,a)])−EπE​​[c(s,a)](3)

Now let c~∈\irlψ(πE)\tilde{c}\in\irl_{\psi}(\pi_{E})c~∈\irlψ​(πE​). We are interested in a policy given by \rl(c~)\rl(\tilde{c})\rl(c~)—this is the policy given by running reinforcement learning on the output of IRL.

令 c~∈\irlψ(πE)\tilde{c}\in\irl_{\psi}(\pi_{E})c~∈\irlψ​(πE​)。我们关心的是 \rl(c~)\rl(\tilde{c})\rl(c~) 给出的策略——也就是对 IRL 输出再跑强化学习得到的策略。

To characterize \rl(c~)\rl(\tilde{c})\rl(c~), it will be useful to transform optimization problems over policies into convex problems. For a policy π∈Π\pi\in\Piπ∈Π, define its occupancy measure ρπ:S×A→R\rho_{\pi}:\mathcal{S}\times\mathcal{A}\rightarrow\mathbb{R}ρπ​:S×A→R as ρπ(s,a)=π(a∣s)∑t=0∞γtP(st=s∣π)\rho_{\pi}(s,a)=\pi(a|s)\sum_{t=0}^{\infty}\gamma^{t}P(s_{t}=s|\pi)ρπ​(s,a)=π(a∣s)∑t=0∞​γtP(st​=s∣π). The occupancy measure can be interpreted as the distribution of state-action pairs that an agent encounters when navigating the environment with policy π\piπ, and it allows us to write Eπ[c(s,a)]=∑s,aρπ(s,a)c(s,a)\mathbb{E}_{\pi}[c(s,a)]=\sum_{s,a}\rho_{\pi}(s,a)c(s,a)Eπ​[c(s,a)]=∑s,a​ρπ​(s,a)c(s,a) for any cost function ccc. A basic result [21] is that the set of valid occupancy measures D≜{ρπ:π∈Π}\mathcal{D}\triangleq\{\rho_{\pi}:\pi\in\Pi\}D≜{ρπ​:π∈Π} can be written as a feasible set of affine constraints: if p0(s)p_{0}(s)p0​(s) is the distribution of starting states and P(s′∣s,a)P(s^{\prime}|s,a)P(s′∣s,a) is the dynamics model, then D={ρ:ρ≥0and∑aρ(s,a)=p0(s)+γ∑s′,aP(s∣s′,a)ρ(s′,a)  ∀ s∈S}\mathcal{D}=\left\{\rho:\rho\geq 0\quad\mathrm{and}\quad\sum_{a}\rho(s,a)=p_{0}(s)+\gamma\sum_{s^{\prime},a}P(s|s^{\prime},a)\rho(s^{\prime},a)\ \ \forall\ s\in\mathcal{S}\right\}D={ρ:ρ≥0and∑a​ρ(s,a)=p0​(s)+γ∑s′,a​P(s∣s′,a)ρ(s′,a)  ∀ s∈S}. Furthermore, there is a one-to-one correspondence between Π\PiΠ and D\mathcal{D}D:

为刻画 \rl(c~)\rl(\tilde{c})\rl(c~),把策略上的优化问题改写成凸问题会很方便。对 π∈Π\pi\in\Piπ∈Π,定义占用测度 ρπ:S×A→R\rho_{\pi}:\mathcal{S}\times\mathcal{A}\rightarrow\mathbb{R}ρπ​:S×A→R 为 ρπ(s,a)=π(a∣s)∑t=0∞γtP(st=s∣π)\rho_{\pi}(s,a)=\pi(a|s)\sum_{t=0}^{\infty}\gamma^{t}P(s_{t}=s|\pi)ρπ​(s,a)=π(a∣s)∑t=0∞​γtP(st​=s∣π)。占用测度可理解为智能体用策略 π\piπ 在环境中游走时遇到的状态–动作对分布,并让我们把任意代价 ccc 写成 Eπ[c(s,a)]=∑s,aρπ(s,a)c(s,a)\mathbb{E}_{\pi}[c(s,a)]=\sum_{s,a}\rho_{\pi}(s,a)c(s,a)Eπ​[c(s,a)]=∑s,a​ρπ​(s,a)c(s,a)。一个基本结果 [21] 是:合法占用测度集合 D≜{ρπ:π∈Π}\mathcal{D}\triangleq\{\rho_{\pi}:\pi\in\Pi\}D≜{ρπ​:π∈Π} 可写成仿射约束的可行集:若 p0(s)p_{0}(s)p0​(s) 是起始状态分布、P(s′∣s,a)P(s^{\prime}|s,a)P(s′∣s,a) 是动力学,则 D={ρ:ρ≥0and∑aρ(s,a)=p0(s)+γ∑s′,aP(s∣s′,a)ρ(s′,a)  ∀ s∈S}\mathcal{D}=\left\{\rho:\rho\geq 0\quad\mathrm{and}\quad\sum_{a}\rho(s,a)=p_{0}(s)+\gamma\sum_{s^{\prime},a}P(s|s^{\prime},a)\rho(s^{\prime},a)\ \ \forall\ s\in\mathcal{S}\right\}D={ρ:ρ≥0and∑a​ρ(s,a)=p0​(s)+γ∑s′,a​P(s∣s′,a)ρ(s′,a)  ∀ s∈S}。此外 Π\PiΠ 与 D\mathcal{D}D 一一对应:

Proposition 3.1(Theorem 2 of Syed et al. 2008).

If ρ∈D\rho\in\mathcal{D}ρ∈D, then ρ\rhoρ is the occupancy measure for πρ(a∣s)≜ρ(s,a)/∑a′ρ(s,a′)\pi_{\rho}(a|s)\triangleq\rho(s,a)/\sum_{a^{\prime}}\rho(s,a^{\prime})πρ​(a∣s)≜ρ(s,a)/∑a′​ρ(s,a′), and πρ\pi_{\rho}πρ​ is the only policy whose occupancy measure is ρ\rhoρ.

命题 3.1(Syed 等人 2008 定理 2)。

若 ρ∈D\rho\in\mathcal{D}ρ∈D,则 ρ\rhoρ 是 πρ(a∣s)≜ρ(s,a)/∑a′ρ(s,a′)\pi_{\rho}(a|s)\triangleq\rho(s,a)/\sum_{a^{\prime}}\rho(s,a^{\prime})πρ​(a∣s)≜ρ(s,a)/∑a′​ρ(s,a′) 的占用测度,且 πρ\pi_{\rho}πρ​ 是唯一以 ρ\rhoρ 为占用测度的策略。

We are therefore justified in writing πρ\pi_{\rho}πρ​ to denote the unique policy for an occupancy measure ρ\rhoρ. We will need one more tool: for a function f:RS×A→R‾f:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}f:RS×A→R, its convex conjugate f∗:RS×A→R‾f^{*}:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}f∗:RS×A→R is given by f∗(x)=sup⁡y∈RS×AxTy−f(y)f^{*}(x)=\sup_{y\in\mathbb{R}^{\mathcal{S}\times\mathcal{A}}}x^{T}y-f(y)f∗(x)=supy∈RS×A​xTy−f(y).

因此我们可以写 πρ\pi_{\rho}πρ​ 表示占用测度 ρ\rhoρ 对应的唯一策略。还需要一个工具:对 f:RS×A→R‾f:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}f:RS×A→R,其凸共轭 f∗:RS×A→R‾f^{*}:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}f∗:RS×A→R 定义为 f∗(x)=sup⁡y∈RS×AxTy−f(y)f^{*}(x)=\sup_{y\in\mathbb{R}^{\mathcal{S}\times\mathcal{A}}}x^{T}y-f(y)f∗(x)=supy∈RS×A​xTy−f(y)。

Now, we are ready to characterize \rl(c~)\rl(\tilde{c})\rl(c~), the policy learned by RL on the cost recovered by IRL:

现在可以刻画 \rl(c~)\rl(\tilde{c})\rl(c~),即对 IRL 恢复的代价再跑 RL 学到的策略:

Proposition 3.2.

\rl∘\irlψ(πE)=arg min⁡π∈Π−H(π)+ψ∗(ρπ−ρπE)\hfill (4)\rl\circ\irl_{\psi}(\pi_{E})=\argmin_{\pi\in\Pi}-H(\pi)+\psi^{*}(\rho_{\pi}-\rho_{\pi_{E}})\hfill\ (4)\rl∘\irlψ​(πE​)=argminπ∈Π​−H(π)+ψ∗(ρπ​−ρπE​​)\hfill (4)

命题 3.2。

\rl∘\irlψ(πE)=arg min⁡π∈Π−H(π)+ψ∗(ρπ−ρπE)\hfill (4)\rl\circ\irl_{\psi}(\pi_{E})=\argmin_{\pi\in\Pi}-H(\pi)+\psi^{*}(\rho_{\pi}-\rho_{\pi_{E}})\hfill\ (4)\rl∘\irlψ​(πE​)=argminπ∈Π​−H(π)+ψ∗(ρπ​−ρπE​​)\hfill (4)

The proof of Proposition 3.2 is in Section A.1. The proof relies on the observation that the optimal cost function and policy form a saddle point of a certain function. IRL finds one coordinate of this saddle point, and running reinforcement learning on the output of IRL reveals the other coordinate.

命题 3.2 的证明见第 A.1 节。证明依赖一个观察:最优代价与策略构成某函数的鞍点。IRL 找到鞍点的一个坐标,对 IRL 输出再跑强化学习则揭示另一个坐标。

Proposition 3.2 tells us that ψ\psiψ-regularized inverse reinforcement learning, implicitly, seeks a policy whose occupancy measure is close to the expert’s, as measured by the convex function ψ∗\psi^{*}ψ∗. Enticingly, this suggests that various settings of ψ\psiψ lead to various imitation learning algorithms that directly solve the optimization problem given by Proposition 3.2. We explore such algorithms in Sections 4 and 5, where we show that certain settings of ψ\psiψ lead to both existing algorithms and a novel one.

命题 3.2 告诉我们:ψ\psiψ-正则的逆强化学习,隐含地在寻找占用测度按凸函数 ψ∗\psi^{*}ψ∗ 度量、接近专家的策略。这很诱人:它暗示不同的 ψ\psiψ 设置会直接对应命题 3.2 所给优化问题的不同模仿学习算法。第 4、5 节将探索这类算法,并证明某些 ψ\psiψ 既覆盖已有算法,也给出新算法。

The special case when ψ\psiψ is a constant function is particularly illuminating, so we state and show it directly using concepts from convex optimization.

ψ\psiψ 为常函数的特例特别有启发性,我们直接用凸优化概念陈述并证明。

Corollary 3.2.1.

If ψ\psiψ is a constant function, c~∈\irlψ(πE)\tilde{c}\in\irl_{\psi}(\pi_{E})c~∈\irlψ​(πE​), and π~∈\rl(c~)\tilde{\pi}\in\rl(\tilde{c})π~∈\rl(c~), then ρπ~=ρπE\rho_{\tilde{\pi}}=\rho_{\pi_{E}}ρπ~​=ρπE​​.

推论 3.2.1。

若 ψ\psiψ 为常函数,c~∈\irlψ(πE)\tilde{c}\in\irl_{\psi}(\pi_{E})c~∈\irlψ​(πE​),且 π~∈\rl(c~)\tilde{\pi}\in\rl(\tilde{c})π~∈\rl(c~),则 ρπ~=ρπE\rho_{\tilde{\pi}}=\rho_{\pi_{E}}ρπ~​=ρπE​​。

In other words, if there were no cost regularization at all, then the recovered policy will exactly match the expert’s occupancy measure. To show this, we will need a lemma that lets us speak about causal entropies of occupancy measures:

换言之,若完全没有代价正则,恢复出的策略会精确匹配专家的占用测度。为此需要一个引理,使我们能谈论占用测度上的因果熵:

Lemma 3.1.

Let Hˉ(ρ)=−∑s,aρ(s,a)log⁡(ρ(s,a)/∑a′ρ(s,a′))\bar{H}(\rho)=-\sum_{s,a}\rho(s,a)\log(\rho(s,a)/\sum_{a^{\prime}}\rho(s,a^{\prime}))Hˉ(ρ)=−∑s,a​ρ(s,a)log(ρ(s,a)/∑a′​ρ(s,a′)). Then, Hˉ\bar{H}Hˉ is strictly concave, and for all π∈Π\pi\in\Piπ∈Π and ρ∈D\rho\in\mathcal{D}ρ∈D, we have H(π)=Hˉ(ρπ)H(\pi)=\bar{H}(\rho_{\pi})H(π)=Hˉ(ρπ​) and Hˉ(ρ)=H(πρ)\bar{H}(\rho)=H(\pi_{\rho})Hˉ(ρ)=H(πρ​).

引理 3.1。

令 Hˉ(ρ)=−∑s,aρ(s,a)log⁡(ρ(s,a)/∑a′ρ(s,a′))\bar{H}(\rho)=-\sum_{s,a}\rho(s,a)\log(\rho(s,a)/\sum_{a^{\prime}}\rho(s,a^{\prime}))Hˉ(ρ)=−∑s,a​ρ(s,a)log(ρ(s,a)/∑a′​ρ(s,a′))。则 Hˉ\bar{H}Hˉ 严格凹,且对所有 π∈Π\pi\in\Piπ∈Π、ρ∈D\rho\in\mathcal{D}ρ∈D,有 H(π)=Hˉ(ρπ)H(\pi)=\bar{H}(\rho_{\pi})H(π)=Hˉ(ρπ​) 以及 Hˉ(ρ)=H(πρ)\bar{H}(\rho)=H(\pi_{\rho})Hˉ(ρ)=H(πρ​)。

The proof of this lemma is in Section A.1. Proposition 3.1 and Lemma 3.1 together allow us to freely switch between policies and occupancy measures when considering functions involving causal entropy and expected costs, as in the following lemma:

该引理证明见第 A.1 节。命题 3.1 与引理 3.1 合在一起,让我们在涉及因果熵与期望代价的函数上可以在策略与占用测度之间自由切换,如下述引理:

Lemma 3.2.

If L(π,c)=−H(π)+Eπ[c(s,a)]L(\pi,c)=-H(\pi)+\mathbb{E}_{\pi}[c(s,a)]L(π,c)=−H(π)+Eπ​[c(s,a)] and Lˉ(ρ,c)=−Hˉ(ρ)+∑s,aρ(s,a)c(s,a)\bar{L}(\rho,c)=-\bar{H}(\rho)+\sum_{s,a}\rho(s,a)c(s,a)Lˉ(ρ,c)=−Hˉ(ρ)+∑s,a​ρ(s,a)c(s,a), then, for all cost functions ccc, L(π,c)=Lˉ(ρπ,c)L(\pi,c)=\bar{L}(\rho_{\pi},c)L(π,c)=Lˉ(ρπ​,c) for all policies π∈Π\pi\in\Piπ∈Π, and Lˉ(ρ,c)=L(πρ,c)\bar{L}(\rho,c)=L(\pi_{\rho},c)Lˉ(ρ,c)=L(πρ​,c) for all occupancy measures ρ∈D\rho\in\mathcal{D}ρ∈D.

引理 3.2。

若 L(π,c)=−H(π)+Eπ[c(s,a)]L(\pi,c)=-H(\pi)+\mathbb{E}_{\pi}[c(s,a)]L(π,c)=−H(π)+Eπ​[c(s,a)] 且 Lˉ(ρ,c)=−Hˉ(ρ)+∑s,aρ(s,a)c(s,a)\bar{L}(\rho,c)=-\bar{H}(\rho)+\sum_{s,a}\rho(s,a)c(s,a)Lˉ(ρ,c)=−Hˉ(ρ)+∑s,a​ρ(s,a)c(s,a),则对一切代价 ccc:对所有 π∈Π\pi\in\Piπ∈Π 有 L(π,c)=Lˉ(ρπ,c)L(\pi,c)=\bar{L}(\rho_{\pi},c)L(π,c)=Lˉ(ρπ​,c);对所有 ρ∈D\rho\in\mathcal{D}ρ∈D 有 Lˉ(ρ,c)=L(πρ,c)\bar{L}(\rho,c)=L(\pi_{\rho},c)Lˉ(ρ,c)=L(πρ​,c)。

Now, we are ready to give a direct proof of Corollary 3.2.1.

现在可以直接证明推论 3.2.1。

Proof of Corollary 3.2.1.

Define Lˉ(ρ,c)=−Hˉ(ρ)+∑s,ac(s,a)(ρ(s,a)−ρE(s,a))\bar{L}(\rho,c)=-\bar{H}(\rho)+\sum_{s,a}c(s,a)(\rho(s,a)-\rho_{E}(s,a))Lˉ(ρ,c)=−Hˉ(ρ)+∑s,a​c(s,a)(ρ(s,a)−ρE​(s,a)). Given that ψ\psiψ is a constant function, we have the following, due to Lemma 3.2:

推论 3.2.1 的证明。

定义 Lˉ(ρ,c)=−Hˉ(ρ)+∑s,ac(s,a)(ρ(s,a)−ρE(s,a))\bar{L}(\rho,c)=-\bar{H}(\rho)+\sum_{s,a}c(s,a)(\rho(s,a)-\rho_{E}(s,a))Lˉ(ρ,c)=−Hˉ(ρ)+∑s,a​c(s,a)(ρ(s,a)−ρE​(s,a))。鉴于 ψ\psiψ 为常函数,由引理 3.2 有:

c~∈\irlψ(πE)=arg max⁡c∈RS×Amin⁡π∈Π−H(π)+Eπ[c(s,a)]−EπE[c(s,a)]+const.=arg max⁡c∈RS×Amin⁡ρ∈D−Hˉ(ρ)+∑s,aρ(s,a)c(s,a)−∑s,aρE(s,a)c(s,a)=arg max⁡c∈RS×Amin⁡ρ∈DLˉ(ρ,c).(5)\displaystyle\tilde{c} \\ \displaystyle\in\irl_{\psi}(\pi_{E})=\argmax_{c\in\mathbb{R}^{\mathcal{S}\times\mathcal{A}}}\min_{\pi\in\Pi}-H(\pi)+\mathbb{E}_{\pi}[c(s,a)]-\mathbb{E}_{\pi_{E}}[c(s,a)]+\mathrm{const.} \\ \displaystyle=\argmax_{c\in\mathbb{R}^{\mathcal{S}\times\mathcal{A}}}\min_{\rho\in\mathcal{D}}-\bar{H}(\rho)+\sum_{s,a}\rho(s,a)c(s,a)-\sum_{s,a}\rho_{E}(s,a)c(s,a)=\argmax_{c\in\mathbb{R}^{\mathcal{S}\times\mathcal{A}}}\min_{\rho\in\mathcal{D}}\bar{L}(\rho,c). \tag{5}c~∈\irlψ​(πE​)=c∈RS×Aargmax​π∈Πmin​−H(π)+Eπ​[c(s,a)]−EπE​​[c(s,a)]+const.=c∈RS×Aargmax​ρ∈Dmin​−Hˉ(ρ)+s,a∑​ρ(s,a)c(s,a)−s,a∑​ρE​(s,a)c(s,a)=c∈RS×Aargmax​ρ∈Dmin​Lˉ(ρ,c).(5)

This is the dual of the optimization problem

这是优化问题

\minimizeρ∈D−Hˉ(ρ)subject to ρ(s,a)=ρE(s,a)∀ s∈S,a∈A(7)\displaystyle\minimize_{\rho\in\mathcal{D}}-\bar{H}(\rho)\quad\text{subject to }\quad\rho(s,a)=\rho_{E}(s,a)\quad\forall\ s\in\mathcal{S},a\in\mathcal{A} \tag{7}\minimizeρ∈D​−Hˉ(ρ)subject to ρ(s,a)=ρE​(s,a)∀ s∈S,a∈A(7)

with Lagrangian Lˉ\bar{L}Lˉ, for which the costs c(s,a)c(s,a)c(s,a) serve as dual variables for equality constraints. Thus, c~\tilde{c}c~ is a dual optimum for 7. Because D\mathcal{D}D is a convex set and −Hˉ-\bar{H}−Hˉ is convex, strong duality holds; moreover, Lemma 3.1 guarantees that −Hˉ-\bar{H}−Hˉ is in fact strictly convex, so the primal optimum can be uniquely recovered from the dual optimum [4, Section 5.5.5] via ρ~=arg min⁡ρ∈DLˉ(ρ,c~)=arg min⁡ρ∈D−Hˉ(ρ)+∑s,ac~(s,a)ρ(s,a)=ρE,\tilde{\rho}=\argmin_{\rho\in\mathcal{D}}\bar{L}(\rho,\tilde{c})=\argmin_{\rho\in\mathcal{D}}-\bar{H}(\rho)+\sum_{s,a}\tilde{c}(s,a)\rho(s,a)=\rho_{E},ρ~​=argminρ∈D​Lˉ(ρ,c~)=argminρ∈D​−Hˉ(ρ)+∑s,a​c~(s,a)ρ(s,a)=ρE​, where the first equality indicates that ρ~\tilde{\rho}ρ~​ is the unique minimizer of Lˉ(⋅,c~)\bar{L}(\cdot,\tilde{c})Lˉ(⋅,c~), and the third follows from the constraints in the primal problem 7. But if π~∈\rl(c~)\tilde{\pi}\in\rl(\tilde{c})π~∈\rl(c~), then, by Lemma 3.2, its occupancy measure satisfies ρπ~=ρ~=ρE\rho_{\tilde{\pi}}=\tilde{\rho}=\rho_{E}ρπ~​=ρ~​=ρE​. ∎

的对偶,拉格朗日量为 Lˉ\bar{L}Lˉ,代价 c(s,a)c(s,a)c(s,a) 充当等式约束的对偶变量。于是 c~\tilde{c}c~ 是 (7) 的对偶最优。因为 D\mathcal{D}D 凸且 −Hˉ-\bar{H}−Hˉ 凸,强对偶成立;再由引理 3.1,−Hˉ-\bar{H}−Hˉ 实际严格凸,故可从对偶最优唯一恢复原问题最优 [4, 第 5.5.5 节]:ρ~=arg min⁡ρ∈DLˉ(ρ,c~)=arg min⁡ρ∈D−Hˉ(ρ)+∑s,ac~(s,a)ρ(s,a)=ρE\tilde{\rho}=\argmin_{\rho\in\mathcal{D}}\bar{L}(\rho,\tilde{c})=\argmin_{\rho\in\mathcal{D}}-\bar{H}(\rho)+\sum_{s,a}\tilde{c}(s,a)\rho(s,a)=\rho_{E}ρ~​=argminρ∈D​Lˉ(ρ,c~)=argminρ∈D​−Hˉ(ρ)+∑s,a​c~(s,a)ρ(s,a)=ρE​,其中第一个等号表明 ρ~\tilde{\rho}ρ~​ 是 Lˉ(⋅,c~)\bar{L}(\cdot,\tilde{c})Lˉ(⋅,c~) 的唯一极小点,第三个等号来自原问题 (7) 的约束。但若 π~∈\rl(c~)\tilde{\pi}\in\rl(\tilde{c})π~∈\rl(c~),则由引理 3.2,其占用测度满足 ρπ~=ρ~=ρE\rho_{\tilde{\pi}}=\tilde{\rho}=\rho_{E}ρπ~​=ρ~​=ρE​。∎

From this argument, we can deduce the following:

由此论证可推出:

IRL is a dual of an occupancy measure matching problem, and the recovered cost function is the dual optimum. Classic IRL algorithms that solve reinforcement learning repeatedly in an inner loop, such as the algorithm of Ziebart et al. 2008 that runs a variant of value iteration in an inner loop, can be interpreted as a form of dual ascent, in which one repeatedly solves the primal problem (reinforcement learning) with fixed dual values (costs). Dual ascent is effective if solving the unconstrained primal is efficient, but in the case of IRL, it amounts to reinforcement learning!

IRL 是占用测度匹配问题的对偶,恢复出的代价函数是对偶最优。那些在内环反复求解强化学习的经典 IRL 算法——例如 Ziebart 等人 2008 在内环跑一种值迭代变体——可解释为对偶上升:反复用固定对偶变量(代价)求解原问题(强化学习)。若无约束原问题求解高效,对偶上升就有效;但在 IRL 里,这恰恰等于强化学习!

The induced optimal policy is the primal optimum. The induced optimal policy is obtained by running RL after IRL, which is exactly the act of recovering the primal optimum from the dual optimum; that is, optimizing the Lagrangian with the dual variables fixed at the dual optimum values. Strong duality implies that this induced optimal policy is indeed the primal optimum, and therefore matches occupancy measures with the expert. IRL is traditionally defined as the act of finding a cost function such that the expert policy is uniquely optimal, but now, we can alternatively view IRL as a procedure that tries to induce a policy that matches the expert’s occupancy measure.

诱导出的最优策略是原问题最优。 诱导最优策略由 IRL 之后再跑 RL 得到,正好是从对偶最优恢复原问题最优;也就是把对偶变量固定在对偶最优值上优化拉格朗日量。强对偶意味着该诱导最优策略确为原问题最优,因而与专家占用测度匹配。IRL 传统上定义为寻找使专家策略唯一最优的代价;现在也可把 IRL 看成试图诱导出与专家占用测度匹配的策略的过程。

4 Practical occupancy measure matching

4 实用的占用测度匹配

We saw in Corollary 3.2.1 that if ψ\psiψ is constant, the resulting primal problem 7 simply matches occupancy measures with expert at all states and actions. Such an algorithm, however, is not practically useful. In reality, the expert trajectory distribution will be provided only as a finite set of samples, so in large environments, most of the expert’s occupancy measure values will be exactly zero, and exact occupancy measure matching will force the learned policy to never visit these unseen state-action pairs simply due to lack of data. Furthermore, with large environments, we would like to use function approximation to learn a parameterized policy πθ\pi_{\theta}πθ​. The resulting optimization problem of finding the appropriate θ\thetaθ would have as many constraints as points in S×A\mathcal{S}\times\mathcal{A}S×A, leading to an intractably large problem and defeating the very purpose of function approximation.

推论 3.2.1 表明:若 ψ\psiψ 为常数,所得原问题 (7) 只是在所有状态与动作上匹配专家占用测度。但这样的算法并不实用。现实中专家轨迹分布只以有限样本给出,在大环境里专家占用测度的多数取值会精确为 0,精确匹配会迫使学到的策略永远不去那些未见过的状态–动作对,仅仅因为缺数据。再者,大环境中我们希望用函数逼近来学参数化策略 πθ\pi_{\theta}πθ​。找合适 θ\thetaθ 的优化问题会有与 S×A\mathcal{S}\times\mathcal{A}S×A 点数一样多的约束,既不可行又违背函数逼近的初衷。

Keeping in mind that we wish to eventually develop an imitation learning algorithm suitable for large environments, we would like to relax Eq. 7 into the following form, motivated by Proposition 3.2:

既然最终目标是适合大环境的模仿学习算法,我们希望把式 (7) 松弛成由命题 3.2 启发的如下形式:

\minimizeπ dψ(ρπ,ρE)−H(π)(8)\displaystyle\minimize_{\pi}\ d_{\psi}(\rho_{\pi},\rho_{E})-H(\pi) \tag{8}\minimizeπ​ dψ​(ρπ​,ρE​)−H(π)(8)

by modifying the IRL regularizer ψ\psiψ so that dψ(ρπ,ρE)≜ψ∗(ρπ−ρE)d_{\psi}(\rho_{\pi},\rho_{E})\triangleq\psi^{*}(\rho_{\pi}-\rho_{E})dψ​(ρπ​,ρE​)≜ψ∗(ρπ​−ρE​) smoothly penalizes violations in difference between the occupancy measures.

做法是修改 IRL 正则项 ψ\psiψ,使 dψ(ρπ,ρE)≜ψ∗(ρπ−ρE)d_{\psi}(\rho_{\pi},\rho_{E})\triangleq\psi^{*}(\rho_{\pi}-\rho_{E})dψ​(ρπ​,ρE​)≜ψ∗(ρπ​−ρE​) 平滑地惩罚占用测度之差的违背。

Entropy-regularized apprenticeship learning

It turns out that with certain settings of ψ\psiψ, Eq. 8 takes on the form of regularized variants of existing apprenticeship learning algorithms, which indeed do scale to large environments with parameterized policies [11]. For a class of cost functions C⊂RS×A\mathcal{C}\subset\mathbb{R}^{\mathcal{S}\times\mathcal{A}}C⊂RS×A, an apprenticeship learning algorithm finds a policy that performs better than the expert across C\mathcal{C}C, by optimizing the objective

熵正则的学徒学习

事实证明,对某些 ψ\psiψ,式 (8) 会变成已有学徒学习(apprenticeship learning)算法的正则化变体,而这类算法确可用参数化策略扩到大环境 [11]。对代价类 C⊂RS×A\mathcal{C}\subset\mathbb{R}^{\mathcal{S}\times\mathcal{A}}C⊂RS×A,学徒学习寻找在整个 C\mathcal{C}C 上优于专家的策略,目标为

\minimizeπ max⁡c∈CEπ[c(s,a)]−EπE[c(s,a)](9)\displaystyle\minimize_{\pi}\ \max_{c\in\mathcal{C}}\mathbb{E}_{\pi}[c(s,a)]-\mathbb{E}_{\pi_{E}}[c(s,a)] \tag{9}\minimizeπ​ c∈Cmax​Eπ​[c(s,a)]−EπE​​[c(s,a)](9)

Classic apprenticeship learning algorithms restrict C\mathcal{C}C to convex sets given by linear combinations of basis functions f1,…,fdf_{1},\dotsc,f_{d}f1​,…,fd​, which give rise a feature vector f(s,a)=[f1(s,a),…,fd(s,a)]f(s,a)=[f_{1}(s,a),\dotsc,f_{d}(s,a)]f(s,a)=[f1​(s,a),…,fd​(s,a)] for each state-action pair. Abbeel and Ng 2004 and Syed et al. 2008 use, respectively,

经典学徒学习把 C\mathcal{C}C 限制为由基函数 f1,…,fdf_{1},\dotsc,f_{d}f1​,…,fd​ 的线性组合给出的凸集,从而每个状态–动作对有特征向量 f(s,a)=[f1(s,a),…,fd(s,a)]f(s,a)=[f_{1}(s,a),\dotsc,f_{d}(s,a)]f(s,a)=[f1​(s,a),…,fd​(s,a)]。Abbeel 与 Ng 2004 以及 Syed 等人 2008 分别使用

Clinear={∑iwifi : ∥w∥2≤1}andCconvex={∑iwifi : ∑iwi=1,wi≥0 ∀i}.(10)\displaystyle\mathcal{C_{\text{linear}}}=\left\{\textstyle{\sum}_{i}w_{i}f_{i}\ :\ \|w\|_{2}\leq 1\right\}\quad\text{and}\quad\mathcal{C_{\text{convex}}}=\left\{\textstyle{\sum}_{i}w_{i}f_{i}\ :\ \textstyle{\sum}_{i}w_{i}=1,w_{i}\geq 0\ \forall i\right\}. \tag{10}Clinear​={∑i​wi​fi​ : ∥w∥2​≤1}andCconvex​={∑i​wi​fi​ : ∑i​wi​=1,wi​≥0 ∀i}.(10)

Clinear\mathcal{C_{\text{linear}}}Clinear​ leads to feature expectation matching [1], which minimizes ℓ2\ell_{2}ℓ2​ distance between expected feature vectors: max⁡c∈ClinearEπ[c(s,a)]−EπE[c(s,a)]=∥Eπ[f(s,a)]−EπE[f(s,a)]∥2\max_{c\in\mathcal{C_{\text{linear}}}}\mathbb{E}_{\pi}[c(s,a)]-\mathbb{E}_{\pi_{E}}[c(s,a)]=\|\mathbb{E}_{\pi}[f(s,a)]-\mathbb{E}_{\pi_{E}}[f(s,a)]\|_{2}maxc∈Clinear​​Eπ​[c(s,a)]−EπE​​[c(s,a)]=∥Eπ​[f(s,a)]−EπE​​[f(s,a)]∥2​. Meanwhile, Cconvex\mathcal{C}_{\text{convex}}Cconvex​ leads to MWAL [28] and LPAL [29], which minimize worst-case excess cost among the individual basis functions, as max⁡c∈CconvexEπ[c(s,a)]−EπE[c(s,a)]=max⁡i∈{1,…,d}Eπ[fi(s,a)]−EπE[fi(s,a)]\max_{c\in\mathcal{C_{\text{convex}}}}\mathbb{E}_{\pi}[c(s,a)]-\mathbb{E}_{\pi_{E}}[c(s,a)]=\max_{i\in\{1,\dotsc,d\}}\mathbb{E}_{\pi}[f_{i}(s,a)]-\mathbb{E}_{\pi_{E}}[f_{i}(s,a)]maxc∈Cconvex​​Eπ​[c(s,a)]−EπE​​[c(s,a)]=maxi∈{1,…,d}​Eπ​[fi​(s,a)]−EπE​​[fi​(s,a)].

Clinear\mathcal{C_{\text{linear}}}Clinear​ 导致特征期望匹配 [1],最小化期望特征向量之间的 ℓ2\ell_{2}ℓ2​ 距离:max⁡c∈ClinearEπ[c(s,a)]−EπE[c(s,a)]=∥Eπ[f(s,a)]−EπE[f(s,a)]∥2\max_{c\in\mathcal{C_{\text{linear}}}}\mathbb{E}_{\pi}[c(s,a)]-\mathbb{E}_{\pi_{E}}[c(s,a)]=\|\mathbb{E}_{\pi}[f(s,a)]-\mathbb{E}_{\pi_{E}}[f(s,a)]\|_{2}maxc∈Clinear​​Eπ​[c(s,a)]−EπE​​[c(s,a)]=∥Eπ​[f(s,a)]−EπE​​[f(s,a)]∥2​。而 Cconvex\mathcal{C}_{\text{convex}}Cconvex​ 导致 MWAL [28] 与 LPAL [29],最小化各基函数上的最坏超额代价,因为 max⁡c∈CconvexEπ[c(s,a)]−EπE[c(s,a)]=max⁡i∈{1,…,d}Eπ[fi(s,a)]−EπE[fi(s,a)]\max_{c\in\mathcal{C_{\text{convex}}}}\mathbb{E}_{\pi}[c(s,a)]-\mathbb{E}_{\pi_{E}}[c(s,a)]=\max_{i\in\{1,\dotsc,d\}}\mathbb{E}_{\pi}[f_{i}(s,a)]-\mathbb{E}_{\pi_{E}}[f_{i}(s,a)]maxc∈Cconvex​​Eπ​[c(s,a)]−EπE​​[c(s,a)]=maxi∈{1,…,d}​Eπ​[fi​(s,a)]−EπE​​[fi​(s,a)]。

We now show how Eq. 9 is a special case of Eq. 8 with a certain setting of ψ\psiψ. With the indicator function δC:RS×A→R‾\delta_{\mathcal{C}}:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}δC​:RS×A→R, defined by δC(c)=0\delta_{\mathcal{C}}(c)=0δC​(c)=0 if c∈Cc\in\mathcal{C}c∈C and +∞+\infty+∞ otherwise, we can write the apprenticeship learning objective 9 as

下面说明式 (9) 是式 (8) 在某一 ψ\psiψ 下的特例。用示性函数 δC:RS×A→R‾\delta_{\mathcal{C}}:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}δC​:RS×A→R(c∈Cc\in\mathcal{C}c∈C 时为 0,否则 +∞+\infty+∞),可把学徒学习目标 (9) 写成

max⁡c∈CEπ[c(s,a)] ⁣− ⁣EπE[c(s,a)]= ⁣ ⁣max⁡c∈RS×A ⁣ ⁣−δC(c)+∑s,a(ρπ(s,a) ⁣− ⁣ρπE ⁣(s,a))c(s,a)=δC∗(ρπ ⁣− ⁣ρπE ⁣)\displaystyle\max_{c\in\mathcal{C}}\mathbb{E}_{\pi}[c(s,a)]\!-\!\mathbb{E}_{\pi_{E}}[c(s,a)]=\!\!\max_{c\in\mathbb{R}^{\mathcal{S}\times\mathcal{A}}}\!\!-\delta_{\mathcal{C}}(c)+\sum_{s,a}(\rho_{\pi}(s,a)\!-\!\rho_{\pi_{E}}\!(s,a))c(s,a)=\delta_{\mathcal{C}}^{*}(\rho_{\pi}\!-\!\rho_{\pi_{E}}\!)c∈Cmax​Eπ​[c(s,a)]−EπE​​[c(s,a)]=c∈RS×Amax​−δC​(c)+s,a∑​(ρπ​(s,a)−ρπE​​(s,a))c(s,a)=δC∗​(ρπ​−ρπE​​)

Therefore, we see that entropy-regularized apprenticeship learning

因此,熵正则学徒学习

\minimizeπ−H(π)+max⁡c∈CEπ[c(s,a)]−EπE[c(s,a)](11)\displaystyle\minimize_{\pi}-H(\pi)+\max_{c\in\mathcal{C}}\mathbb{E}_{\pi}[c(s,a)]-\mathbb{E}_{\pi_{E}}[c(s,a)] \tag{11}\minimizeπ​−H(π)+c∈Cmax​Eπ​[c(s,a)]−EπE​​[c(s,a)](11)

is equivalent to performing RL following IRL with cost regularizer ψ=δC\psi=\delta_{\mathcal{C}}ψ=δC​, which forces the implicit IRL procedure to recover a cost function lying in C\mathcal{C}C. Note that we can scale the policy’s entropy regularization strength in Eq. 11 by scaling C\mathcal{C}C by a constant α\alphaα as {αc:c∈C}\{\alpha c:c\in\mathcal{C}\}{αc:c∈C}, recovering the original apprenticeship objective 9 by taking α→∞\alpha\rightarrow\inftyα→∞.

等价于用代价正则项 ψ=δC\psi=\delta_{\mathcal{C}}ψ=δC​ 做 IRL 后再跑 RL,从而迫使隐含 IRL 恢复落在 C\mathcal{C}C 中的代价。注意:用常数 α\alphaα 缩放 C\mathcal{C}C 为 {αc:c∈C}\{\alpha c:c\in\mathcal{C}\}{αc:c∈C},可缩放式 (11) 中策略熵正则强度;令 α→∞\alpha\rightarrow\inftyα→∞ 即恢复原学徒目标 (9)。

Cons of apprenticeship learning

It is known that apprenticeship learning algorithms generally do not recover expert-like policies if C\mathcal{C}C is too restrictive [29, Section 1]—which is often the case for the linear subspaces used by feature expectation matching, MWAL, and LPAL, unless the basis functions f1,…,fdf_{1},\dotsc,f_{d}f1​,…,fd​ are very carefully designed. Intuitively, unless the true expert cost function (assuming it exists) lies in C\mathcal{C}C, there is no guarantee that if π\piπ performs better than πE\pi_{E}πE​ on all of C\mathcal{C}C, then π\piπ equals πE\pi_{E}πE​. With the aforementioned insight based on Proposition 3.2 that apprenticeship learning is equivalent to RL following IRL, we can understand exactly why apprenticeship learning may fail to imitate: it forces πE\pi_{E}πE​ to be encoded as an element of C\mathcal{C}C. If C\mathcal{C}C does not include a cost function that explains expert behavior well, then attempting to recover a policy from such an encoding will not succeed.

学徒学习的缺点

已知若 C\mathcal{C}C 过于受限,学徒学习一般无法恢复像专家的策略 [29, 第 1 节]——特征期望匹配、MWAL、LPAL 所用的线性子空间往往正是如此,除非基函数 f1,…,fdf_{1},\dotsc,f_{d}f1​,…,fd​ 设计得极仔细。直观上,除非真正的专家代价(假定存在)落在 C\mathcal{C}C 中,否则即使 π\piπ 在整个 C\mathcal{C}C 上优于 πE\pi_{E}πE​,也不能保证 π\piπ 等于 πE\pi_{E}πE​。借助命题 3.2「学徒学习等价于 IRL 后接 RL」的洞见,可以精确理解学徒学习为何可能失败:它强迫把 πE\pi_{E}πE​ 编码成 C\mathcal{C}C 中的一个元素。若 C\mathcal{C}C 里没有能很好解释专家行为的代价,从这个编码恢复策略就不会成功。

Pros of apprenticeship learning

While restrictive cost classes C\mathcal{C}C may not lead to exact imitation, apprenticeship learning with such C\mathcal{C}C can scale to large state and action spaces with policy function approximation. Ho et al. 2016 rely on the following policy gradient formula for the apprenticeship objective 9 for a parameterized policy πθ\pi_{\theta}πθ​:

学徒学习的优点

尽管受限的 C\mathcal{C}C 未必带来精确模仿,带这种 C\mathcal{C}C 的学徒学习却能借助策略函数逼近扩到大状态与动作空间。Ho 等人 2016 依赖参数化策略 πθ\pi_{\theta}πθ​ 上学徒目标 (9) 的如下策略梯度公式:

$$\displaystyle\begin{split}&\nabla_{\theta}\max_{c\in\mathcal{C}}\mathbb{E}{\pi{\theta}}[c(s,a)]-\mathbb{E}{\pi{E}}[c(s,a)]=\nabla_{\theta}\mathbb{E}{\pi{\theta}}[c^{}(s,a)]=\mathbb{E}{\pi{\theta}}\left[\nabla_{\theta}\log\pi_{\theta}(a|s)Q_{c^{}}(s,a)\right]\
&\text{where}\ c^{}!=\argmax_{c\in\mathcal{C}}\mathbb{E}{\pi{\theta}}[c(s,a)]-\mathbb{E}{\pi{E}}[c(s,a)],\ Q_{c^{}}(\bar{s},\bar{a})=\mathbb{E}{\pi{\theta}}[c^{*}(\bar{s},\bar{a}),|,s_{0}=\bar{s},a_{0}=\bar{a}]\end{split} \tag{12}$$

Observing that Eq. 12 is the policy gradient for a reinforcement learning objective with cost c∗c^{*}c∗, Ho et al. 2016 propose an algorithm that alternates between two steps:

观察到式 (12) 正是代价为 c∗c^{*}c∗ 的强化学习目标的策略梯度,Ho 等人 2016 提出在两步之间交替的算法:

  1. Sample trajectories of the current policy πθi\pi_{\theta_{i}}πθi​​ by simulating in the environment, and fit a cost function ci∗c^{*}_{i}ci∗​, as defined in Eq. 12. For the cost classes Clinear\mathcal{C}_{\text{linear}}Clinear​ and Cconvex\mathcal{C}_{\text{convex}}Cconvex​ 10, this cost fitting amounts to evaluating simple analytical expressions [11].
  1. 在环境中仿真,采样当前策略 πθi\pi_{\theta_{i}}πθi​​ 的轨迹,并按式 (12) 拟合代价 ci∗c^{*}_{i}ci∗​。对代价类 Clinear\mathcal{C}_{\text{linear}}Clinear​ 与 Cconvex\mathcal{C}_{\text{convex}}Cconvex​(式 10),这一拟合就是计算简单的解析表达式 [11]。
  1. Form a gradient estimate with Eq. 12 with ci∗c^{*}_{i}ci∗​ and the sampled trajectories, and take a trust region policy optimization (TRPO) [26] step to produce πθi+1\pi_{\theta_{i+1}}πθi+1​​.
  1. 用 ci∗c^{*}_{i}ci∗​ 与采样轨迹按式 (12) 形成梯度估计,再走一步信任域策略优化(TRPO)[26],得到 πθi+1\pi_{\theta_{i+1}}πθi+1​​。

This algorithm relies crucially on the TRPO policy step, which is a natural gradient step constrained to ensure that πθi+1\pi_{\theta_{i+1}}πθi+1​​ does not stray too far πθi\pi_{\theta_{i}}πθi​​, as measured by KL divergence between the two policies averaged over the states in the sampled trajectories. This carefully constructed step scheme ensures that divergence does not occur due to high noise in estimating the gradient 12. We refer the reader to Schulman et al. 2015a for more details on TRPO.

该算法关键依赖 TRPO 策略步:这是带约束的自然梯度步,保证 πθi+1\pi_{\theta_{i+1}}πθi+1​​ 相对 πθi\pi_{\theta_{i}}πθi​​ 不会偏离太远,度量是采样轨迹状态上两策略 KL 散度的平均。这种仔细构造的步进方案避免了因估计梯度 (12) 噪声过大而发散。细节见 Schulman 等人 2015a。

With the TRPO step scheme, Ho et al. 2016 were able train large neural network policies for apprenticeship learning with linear cost function classes 10 in environments with hundreds of observation dimensions. Their use of these linear cost function classes, however, limits their approach to settings in which expert behavior is well-described by such classes. We will draw upon their algorithm to develop an imitation learning method that both scales to large environments and imitates arbitrarily complex expert behavior. To do so, we first turn to proposing a new regularizer ψ\psiψ that wields more expressive power than the regularizers corresponding to Clinear\mathcal{C}_{\text{linear}}Clinear​ and Cconvex\mathcal{C}_{\text{convex}}Cconvex​ 10.

借助 TRPO 步进,Ho 等人 2016 能在有数百维观测的环境中,用线性代价类(式 10)训练大学习网络策略做学徒学习。但线性代价类限制了方法:只有专家行为能被这类函数很好描述时才适用。我们将借用他们的算法,发展一种既能扩到大环境、又能模仿任意复杂专家行为的方法。为此先提出新的正则项 ψ\psiψ,其表达力超过对应 Clinear\mathcal{C}_{\text{linear}}Clinear​ 与 Cconvex\mathcal{C}_{\text{convex}}Cconvex​(式 10)的正则项。

5 Generative adversarial imitation learning

5 生成对抗模仿学习

As discussed in Section 4, the constant regularizer leads to an imitation learning algorithm that exactly matches occupancy measures, but is intractable in large environments. The indicator regularizers for the linear cost function classes 10, on the other hand, lead to algorithms incapable of exactly matching occupancy measures without careful tuning, but are tractable in large environments. We propose the following new cost regularizer that combines the best of both worlds, as we will show in the coming sections:

如第 4 节所论,常正则项带来精确匹配占用测度的算法,但在大环境中不可行;线性代价类(式 10)的示性正则项则带来不经仔细调参就无法精确匹配、却能在大环境中运行的算法。我们提出如下新代价正则项,后文将说明它兼顾两者之长:

$\displaystyle\psi_{\text{GA}}(c)\triangleq\begin{cases}\mathbb{E}_{\pi_{E}}[g(c(s,a))]&ifc<0$\
+\infty&otherwise\end{cases}\ \text{where}\ g(x)=\begin{cases}-x-\log(1-e^{x})&if x<0x<0x<0\
+\infty&otherwise\end{cases} \tag{13}$$

This regularizer places low penalty on cost functions ccc that assign an amount of negative cost to expert state-action pairs; if ccc, however, assigns large costs (close to zero, which is the upper bound for costs feasible for ψGA\psi_{\text{GA}}ψGA​) to the expert, then ψGA\psi_{\text{GA}}ψGA​ will heavily penalize ccc. An interesting property of ψGA\psi_{\text{GA}}ψGA​ is that it is an average over expert data, and therefore can adjust to arbitrary expert datasets. The indicator regularizers δC\delta_{\mathcal{C}}δC​, used by the linear apprenticeship learning algorithms described in Section 4, are always fixed, and cannot adapt to data as ψGA\psi_{\text{GA}}ψGA​ can. Perhaps the most important difference between ψGA\psi_{\text{GA}}ψGA​ and δC\delta_{\mathcal{C}}δC​, however, is that δC\delta_{\mathcal{C}}δC​ forces costs to lie in a small subspace spanned by finitely many basis functions, whereas ψGA\psi_{\text{GA}}ψGA​ allows for any cost function, as long as it is negative everywhere.

该正则项对给专家状态–动作对赋一定负代价的 ccc 惩罚较低;若 ccc 给专家赋接近 0 的大代价(这是 ψGA\psi_{\text{GA}}ψGA​ 可行代价的上界),则会重罚。ψGA\psi_{\text{GA}}ψGA​ 的一个有趣性质是它在专家数据上取平均,因而能适应任意专家数据集。第 4 节线性学徒算法用的示性正则 δC\delta_{\mathcal{C}}δC​ 始终固定,不能像 ψGA\psi_{\text{GA}}ψGA​ 那样随数据调整。ψGA\psi_{\text{GA}}ψGA​ 与 δC\delta_{\mathcal{C}}δC​ 最重要的差别或许是:后者强迫代价落在有限个基函数张成的小子空间,而前者只要代价处处为负,就允许任意代价函数。

Our choice of ψGA\psi_{\text{GA}}ψGA​ is motivated by the following fact, shown in the appendix (Corollary A.1.1):

选择 ψGA\psi_{\text{GA}}ψGA​ 的动机是下述事实(附录推论 A.1.1):

ψGA∗(ρπ−ρπE)=max⁡D∈(0,1)S×AEπ[log⁡(D(s,a))]+EπE[log⁡(1−D(s,a))](14)\displaystyle\psi_{\text{GA}}^{*}(\rho_{\pi}-\rho_{\pi_{E}})=\max_{D\in(0,1)^{\mathcal{S}\times\mathcal{A}}}\mathbb{E}_{\pi}[\log(D(s,a))]+\mathbb{E}_{\pi_{E}}[\log(1-D(s,a))] \tag{14}ψGA∗​(ρπ​−ρπE​​)=D∈(0,1)S×Amax​Eπ​[log(D(s,a))]+EπE​​[log(1−D(s,a))](14)

where the maximum ranges over discriminative classifiers D:S×A→(0,1)D:\mathcal{S}\times\mathcal{A}\rightarrow(0,1)D:S×A→(0,1). Equation 14 is the optimal negative log loss of the binary classification problem of distinguishing between state-action pairs of π\piπ and πE\pi_{E}πE​. It turns out that this optimal loss is (up to a constant shift) the Jensen-Shannon divergence DJS(ρπ,ρπE)≜DKL(ρπ∥(ρπ+ρE)/2)+DKL(ρE∥(ρπ+ρE)/2)D_{\text{JS}}(\rho_{\pi},\rho_{\pi_{E}})\triangleq D_{\text{KL}}\left(\rho_{\pi}\middle\|(\rho_{\pi}+\rho_{E})/2\right)+D_{\text{KL}}\left(\rho_{E}\middle\|(\rho_{\pi}+\rho_{E})/2\right)DJS​(ρπ​,ρπE​​)≜DKL​(ρπ​∥(ρπ​+ρE​)/2)+DKL​(ρE​∥(ρπ​+ρE​)/2), which is a squared metric between distributions [9, 19]. Treating the causal entropy HHH as a policy regularizer, controlled by λ≥0\lambda\geq 0λ≥0, we obtain a new imitation learning algorithm:

其中最大值取遍判别分类器 D:S×A→(0,1)D:\mathcal{S}\times\mathcal{A}\rightarrow(0,1)D:S×A→(0,1)。式 (14) 是区分 π\piπ 与 πE\pi_{E}πE​ 状态–动作对的二分类问题的最优负对数损失。该最优损失(差一个常数平移)正是 Jensen–Shannon 散度 DJS(ρπ,ρπE)≜DKL(ρπ∥(ρπ+ρE)/2)+DKL(ρE∥(ρπ+ρE)/2)D_{\text{JS}}(\rho_{\pi},\rho_{\pi_{E}})\triangleq D_{\text{KL}}\left(\rho_{\pi}\middle\|(\rho_{\pi}+\rho_{E})/2\right)+D_{\text{KL}}\left(\rho_{E}\middle\|(\rho_{\pi}+\rho_{E})/2\right)DJS​(ρπ​,ρπE​​)≜DKL​(ρπ​∥(ρπ​+ρE​)/2)+DKL​(ρE​∥(ρπ​+ρE​)/2),它是分布之间的平方度量 [9, 19]。把因果熵 HHH 当作由 λ≥0\lambda\geq 0λ≥0 控制的策略正则,便得到新的模仿学习算法:

\minimizeπ ψGA∗(ρπ−ρπE)−λH(π)=DJS(ρπ,ρπE)−λH(π),(15)\displaystyle\minimize_{\pi}\ \psi_{\text{GA}}^{*}(\rho_{\pi}-\rho_{\pi_{E}})-\lambda H(\pi)=D_{\text{JS}}(\rho_{\pi},\rho_{\pi_{E}})-\lambda H(\pi), \tag{15}\minimizeπ​ ψGA∗​(ρπ​−ρπE​​)−λH(π)=DJS​(ρπ​,ρπE​​)−λH(π),(15)

which finds a policy whose occupancy measure minimizes Jensen-Shannon divergence to the expert’s. Equation 15 minimizes a true metric between occupancy measures, so, unlike linear apprenticeship learning algorithms, it can imitate expert policies exactly.

它寻找占用测度与专家的 Jensen–Shannon 散度最小的策略。式 (15) 最小化占用测度之间的真度量,因此与线性学徒算法不同,它可以精确模仿专家策略。

Algorithm

Equation 15 draws a connection between imitation learning and generative adversarial networks [9], which train a generative model GGG by having it confuse a discriminative classifier DDD. The job of DDD is to distinguish between the distribution of data generated by GGG and the true data distribution. When DDD cannot distinguish data generated by GGG from the true data, then GGG has successfully matched the true data. In our setting, the learner’s occupancy measure ρπ\rho_{\pi}ρπ​ is analogous to the data distribution generated by GGG, and the expert’s occupancy measure ρπE\rho_{\pi_{E}}ρπE​​ is analogous to the true data distribution.

算法

式 (15) 把模仿学习与生成对抗网络 [9] 联系起来:后者训练生成模型 GGG,使其迷惑判别分类器 DDD。DDD 的任务是区分 GGG 生成的数据分布与真实数据分布;当 DDD 分不清二者时,GGG 就成功匹配了真实数据。在我们的设定里,学习者占用测度 ρπ\rho_{\pi}ρπ​ 类比 GGG 生成的数据分布,专家占用测度 ρπE\rho_{\pi_{E}}ρπE​​ 类比真实数据分布。

Now, we present a practical algorithm, which we call generative adversarial imitation learning (Algorithm 1), for solving Eq. 15 for model-free imitation in large environments. Explicitly, we wish to find a saddle point (π,D)(\pi,D)(π,D) of the expression

下面给出求解式 (15)、面向大环境无模型模仿的实用算法,称为生成对抗模仿学习(算法 1)。明确地说,我们要找表达式

Eπ[log⁡(D(s,a))]+EπE[log⁡(1−D(s,a))]−λH(π)(16)\displaystyle\mathbb{E}_{\pi}[\log(D(s,a))]+\mathbb{E}_{\pi_{E}}[\log(1-D(s,a))]-\lambda H(\pi) \tag{16}Eπ​[log(D(s,a))]+EπE​​[log(1−D(s,a))]−λH(π)(16)

To do so, we first introduce function approximation for π\piπ and DDD: we will fit a parameterized policy πθ\pi_{\theta}πθ​, with weights θ\thetaθ, and a discriminator network Dw:S×A→(0,1)D_{w}:\mathcal{S}\times\mathcal{A}\rightarrow(0,1)Dw​:S×A→(0,1), with weights www. Then, we alternate between an Adam [12] gradient step on www to increase Eq. 16 with respect to DDD, and a TRPO step on θ\thetaθ to decrease Eq. 16 with respect to π\piπ. The TRPO step serves the same purpose as it does with the apprenticeship learning algorithm of Ho et al. 2016: it prevents the policy from changing too much due to noise in the policy gradient. The discriminator network can be interpreted as a local cost function providing learning signal to the policy—specifically, taking a policy step that decreases expected cost with respect to the cost function c(s,a)=log⁡D(s,a)c(s,a)=\log D(s,a)c(s,a)=logD(s,a) will move toward expert-like regions of state-action space, as classified by the discriminator. (We derive an estimator for the causal entropy gradient ∇θH(πθ)\nabla_{\theta}H(\pi_{\theta})∇θ​H(πθ​) in Section A.2.)

的鞍点 (π,D)(\pi,D)(π,D)。为此先对 π\piπ 与 DDD 做函数逼近:拟合带权 θ\thetaθ 的参数化策略 πθ\pi_{\theta}πθ​,以及带权 www、映射 S×A→(0,1)\mathcal{S}\times\mathcal{A}\rightarrow(0,1)S×A→(0,1) 的判别网络 DwD_{w}Dw​。然后交替:用 Adam [12] 对 www 做梯度步以相对 DDD 增大式 (16);用 TRPO 对 θ\thetaθ 做一步以相对 π\piπ 减小式 (16)。TRPO 步与 Ho 等人 2016 的学徒算法作用相同:防止策略因策略梯度噪声而变化过大。判别网络可解释为给策略提供学习信号的局部代价——具体地,相对代价 c(s,a)=log⁡D(s,a)c(s,a)=\log D(s,a)c(s,a)=logD(s,a) 走一步降低期望代价,就会移向判别器判定为「像专家」的状态–动作区域。(因果熵梯度 ∇θH(πθ)\nabla_{\theta}H(\pi_{\theta})∇θ​H(πθ​) 的估计器推导见第 A.2 节。)

1:  Input: Expert trajectories τE∼πE\tau_{E}\sim\pi_{E}τE​∼πE​, initial policy and discriminator parameters θ0,w0\theta_{0},w_{0}θ0​,w0​
2:  for i=0,1,2,…i=0,1,2,\dotsci=0,1,2,… do
3:   Sample trajectories τi∼πθi\tau_{i}\sim\pi_{\theta_{i}}τi​∼πθi​​
4:   Update the discriminator parameters from wiw_{i}wi​ to wi+1w_{i+1}wi+1​ with the gradient ^Eτi[∇wlog⁡(Dw(s,a))]+^EτE[∇wlog⁡(1−Dw(s,a))]\displaystyle\hat{}\mathbb{E}_{\tau_{i}}[\nabla_{w}\log(D_{w}(s,a))]+\hat{}\mathbb{E}_{\tau_{E}}[\nabla_{w}\log(1-D_{w}(s,a))]^Eτi​​[∇w​log(Dw​(s,a))]+^EτE​​[∇w​log(1−Dw​(s,a))] (17)
5:   Take a policy step from θi\theta_{i}θi​ to θi+1\theta_{i+1}θi+1​, using the TRPO rule with cost function log⁡(Dwi+1(s,a))\log(D_{w_{i+1}}(s,a))log(Dwi+1​​(s,a)). Specifically, take a KL-constrained natural gradient step with \displaystyle\begin{split}&\hat{}\mathbb{E}_{\tau_{i}}\left[\nabla_{\theta}\log\pi_{\theta}(a|s)Q(s,a)\right]-\lambda\nabla_{\theta}H(\pi_{\theta}),\\ &\text{where}\ Q(\bar{s},\bar{a})=\hat{}\mathbb{E}_{\tau_{i}}[\log(D_{w_{i+1}}(s,a))\,|\,s_{0}=\bar{s},a_{0}=\bar{a}]\end{split} (18)
6:  end for

Algorithm 1 Generative adversarial imitation learning

1:  输入: 专家轨迹 τE∼πE\tau_{E}\sim\pi_{E}τE​∼πE​,策略与判别器初值 θ0,w0\theta_{0},w_{0}θ0​,w0​
2:  for i=0,1,2,…i=0,1,2,\dotsci=0,1,2,… do
3:   采样轨迹 τi∼πθi\tau_{i}\sim\pi_{\theta_{i}}τi​∼πθi​​
4:   用梯度 ^Eτi[∇wlog⁡(Dw(s,a))]+^EτE[∇wlog⁡(1−Dw(s,a))]\displaystyle\hat{}\mathbb{E}_{\tau_{i}}[\nabla_{w}\log(D_{w}(s,a))]+\hat{}\mathbb{E}_{\tau_{E}}[\nabla_{w}\log(1-D_{w}(s,a))]^Eτi​​[∇w​log(Dw​(s,a))]+^EτE​​[∇w​log(1−Dw​(s,a))] 把判别器参数从 wiw_{i}wi​ 更新到 wi+1w_{i+1}wi+1​(17)
5:   以代价 log⁡(Dwi+1(s,a))\log(D_{w_{i+1}}(s,a))log(Dwi+1​​(s,a)) 按 TRPO 规则,从 θi\theta_{i}θi​ 走到 θi+1\theta_{i+1}θi+1​。具体地,取 KL 约束自然梯度步 \displaystyle\begin{split}&\hat{}\mathbb{E}_{\tau_{i}}\left[\nabla_{\theta}\log\pi_{\theta}(a|s)Q(s,a)\right]-\lambda\nabla_{\theta}H(\pi_{\theta}),\\ &\text{where}\ Q(\bar{s},\bar{a})=\hat{}\mathbb{E}_{\tau_{i}}[\log(D_{w_{i+1}}(s,a))\,|\,s_{0}=\bar{s},a_{0}=\bar{a}]\end{split}(18)
6:  end for

算法 1 生成对抗模仿学习

6 Experiments

6 实验

We evaluated Algorithm 1 against baselines on 9 physics-based control tasks, ranging from low-dimensional control tasks from the classic RL literature—the cartpole [2], acrobot [8], and mountain car [17]—to difficult high-dimensional tasks such as a 3D humanoid locomotion, solved only recently by model-free reinforcement learning [27, 26]. All environments, other than the classic control tasks, were simulated with MuJoCo [30]. See Appendix B for a complete description of all the tasks.

我们在 9 个基于物理的控制任务上对照基线评估算法 1,范围从经典强化学习文献中的低维任务——cartpole [2]、acrobot [8]、mountain car [17]——到近期才被无模型强化学习解决的困难高维任务,如三维人形行走 [27, 26]。除经典控制任务外,其余环境均用 MuJoCo [30] 仿真。任务完整描述见附录 B。

Each task comes with a true cost function, defined in the OpenAI Gym [5]. We first generated expert behavior for these tasks by running TRPO [26] on these true cost functions to create expert policies. Then, to evaluate imitation performance with respect to sample complexity of expert data, we sampled datasets of varying trajectory counts from the expert policies. The trajectories constituting each dataset each consisted of about 50 state-action pairs. We tested Algorithm 1 against three baselines:

每个任务都有 OpenAI Gym [5] 定义的真实代价。我们先在这些真实代价上跑 TRPO [26] 生成专家策略。然后,为评估模仿性能相对专家数据样本量的关系,从专家策略采样不同轨迹条数的数据集;每条轨迹大约含 50 个状态–动作对。算法 1 对照三条基线:

  1. Behavioral cloning: a given dataset of state-action pairs is split into 70% training data and 30% validation data. The policy is trained with supervised learning, using Adam [12] with minibatches of 128 examples, until validation error stops decreasing.
  1. 行为克隆:把给定状态–动作对数据集按 70%/30% 划分训练/验证。用 Adam [12]、每批 128 例做监督学习,直到验证误差不再下降。
  1. Feature expectation matching (FEM): the algorithm of Ho et al. 2016 using the cost function class Clinear\mathcal{C}_{\text{linear}}Clinear​ 10 of Abbeel and Ng 2004
  1. 特征期望匹配(FEM):Ho 等人 2016 的算法,代价类取 Abbeel 与 Ng 2004 的 Clinear\mathcal{C}_{\text{linear}}Clinear​(式 10)
  1. Game-theoretic apprenticeship learning (GTAL): the algorithm of Ho et al. 2016 using the cost function class Cconvex\mathcal{C}_{\text{convex}}Cconvex​ 10 of Syed and Schapire 2007
  1. 博弈论学徒学习(GTAL):Ho 等人 2016 的算法,代价类取 Syed 与 Schapire 2007 的 Cconvex\mathcal{C}_{\text{convex}}Cconvex​(式 10)

We used all algorithms to train policies of the same neural network architecture for all tasks: two hidden layers of 100 units each, with tanh⁡\tanhtanh nonlinearities in between. The discriminator networks for Algorithm 1 also used the same architecture. All networks were always initialized randomly at the start of each trial. For each task, we gave FEM, GTAL, and Algorithm 1 exactly the same amount of environment interaction for training.

所有算法在全部任务上训练同一架构的策略网络:两层各 100 隐单元,中间为 tanh⁡\tanhtanh 非线性。算法 1 的判别网络亦用同一架构。每次试验网络均随机初始化。对每个任务,FEM、GTAL 与算法 1 的环境交互量完全相同。

Figure 1 depicts the results, and the tables in Appendix B provide exact performance numbers. We found that on the classic control tasks (cartpole, acrobot, and mountain car), behavioral cloning suffered in expert data efficiency compared to FEM and GTAL, which for the most part were able produce policies with near-expert performance with a wide range of dataset sizes. On these tasks, our generative adversarial algorithm always produced policies performing better than behavioral cloning, FEM, and GTAL. However, behavioral cloning performed excellently on the Reacher task, on which it was more sample efficient than our algorithm. We were able to slightly improve our algorithm’s performance on Reacher using causal entropy regularization—in the 4-trajectory setting, the improvement from λ=0\lambda=0λ=0 to λ=10−3\lambda=10^{-3}λ=10−3 was statistically significant over training reruns, according to a one-sided Wilcoxon rank-sum test with p=.05p=.05p=.05. We used no causal entropy regularization for all other tasks.

图 1 给出结果,附录 B 的表格提供精确性能数字。在经典控制任务(cartpole、acrobot、mountain car)上,行为克隆相对 FEM、GTAL 在专家数据效率上吃亏,后两者大体上能在多种数据集规模下得到接近专家的策略。这些任务上,我们的生成对抗算法始终优于行为克隆、FEM 与 GTAL。但行为克隆在 Reacher 上表现优异,样本效率高于我们的算法。用因果熵正则可略微改善我们在 Reacher 上的表现——在 4 条轨迹设定下,λ=0\lambda=0λ=0 到 λ=10−3\lambda=10^{-3}λ=10−3 的提升在多次重训上按单侧 Wilcoxon 秩和检验达到 p=.05p=.05p=.05 显著。其余任务未使用因果熵正则。

GAIL imitation results

Figure 1: Performance of imitation learning algorithms across tasks and expert dataset sizes. (a) Classic control and MuJoCo results as reported in the paper.

图 1:各任务、各专家数据集规模下模仿学习算法的性能。(a)文中报告的经典控制与 MuJoCo 结果。

On the other MuJoCo environments, we saw a large performance boost for our algorithm over the baselines. Our algorithm almost always achieved at least 70% of expert performance for all dataset sizes we tested, nearly always dominating all the baselines. FEM and GTAL performed poorly for Ant, producing policies consistently worse than a policy that chooses actions uniformly at random. Behavioral cloning was able to reach satisfactory performance with enough data on HalfCheetah, Hopper, Walker, and Ant; but was unable to achieve more than 60% for Humanoid, on which our algorithm achieved exact expert performance for all tested dataset sizes.

在其余 MuJoCo 环境中,我们的算法相对基线有大幅提升。几乎对所有测试的数据集规模,它都能达到至少 70% 的专家性能,并几乎总是压过全部基线。FEM 与 GTAL 在 Ant 上很差,策略甚至持续差于均匀随机动作。行为克隆在 HalfCheetah、Hopper、Walker、Ant 上数据足够时可达到尚可的表现,但在 Humanoid 上无法超过 60%;而我们的算法在所有测试数据集规模上都达到了精确的专家性能。

7 Discussion and outlook

7 讨论与展望

As we demonstrated, our method is generally quite sample efficient in terms of expert data. However, it is not particularly sample efficient in terms of environment interaction during training. The number of such samples required to estimate the imitation objective gradient 18 was comparable to the number needed for TRPO to train the expert policies from reinforcement signals. We believe that we could significantly improve learning speed for our algorithm by initializing policy parameters with behavioral cloning, which requires no environment interaction at all.

如实验所示,我们的方法在专家数据上一般相当样本高效,但在训练期的环境交互上并不特别高效。估计模仿目标梯度 (18) 所需样本量,与用 TRPO 从强化信号训练专家策略所需量相当。我们相信:用行为克隆初始化策略参数(完全不需要环境交互)可以显著加快学习。

Fundamentally, our method is model free, so it will generally need more environment interaction than model-based methods. Guided cost learning [7], for instance, builds upon guided policy search [13] and inherits its sample efficiency, but also inherits its requirement that the model is well-approximated by iteratively fitted time-varying linear dynamics. Interestingly, both our Algorithm 1 and guided cost learning alternate between policy optimization steps and cost fitting (which we called discriminator fitting), even though the two algorithms are derived completely differently.

从根本上说,我们的方法是无模型的,因此一般会比基于模型的方法需要更多环境交互。例如 guided cost learning [7] 建立在 guided policy search [13] 之上,继承了其样本效率,也继承了「模型须被迭代拟合的时变线性动力学很好近似」的要求。有意思的是,算法 1 与 guided cost learning 都在策略优化与代价拟合(我们称作判别器拟合)之间交替,尽管两者推导路径完全不同。

Our approach builds upon a vast line of work on IRL [31, 1, 29, 28], and hence, just like IRL, our approach does not interact with the expert during training. Our method explores randomly to determine which actions bring a policy’s occupancy measure closer to the expert’s, whereas methods that do interact with the expert, like DAgger [24], can simply ask the expert for such actions. Ultimately, we believe that a method that combines well-chosen environment models with expert interaction will win in terms of sample complexity of both expert data and environment interaction.

我们的方法建立在漫长的 IRL 工作线之上 [31, 1, 29, 28],因而也像 IRL 一样,训练时不与专家交互。我们的方法靠随机探索来判断哪些动作能让策略占用测度更接近专家;而像 DAgger [24] 这类会与专家交互的方法,可以直接向专家要这些动作。最终我们相信:把选得好的环境模型与专家交互结合起来的方法,会在专家数据与环境交互两方面的样本复杂度上胜出。

Acknowledgments

We thank Jayesh K. Gupta and John Schulman for assistance and advice. This work was supported by the SAIL-Toyota Center for AI Research, and by a NSF Graduate Research Fellowship (grant no. DGE-114747).

致谢

感谢 Jayesh K. Gupta 与 John Schulman 的协助与建议。本工作得到 SAIL-Toyota AI 研究中心以及 NSF 研究生研究奖学金(编号 DGE-114747)支持。

References

参考文献

Abbeel and Ng [2004] P. Abbeel and A. Y. Ng. Apprenticeship learning via inverse reinforcement learning. In Proceedings of the 21st International Conference on Machine Learning , 2004.

Barto et al. [1983] A. G. Barto, R. S. Sutton, and C. W. Anderson. Neuronlike adaptive elements that can solve difficult learning control problems. Systems, Man and Cybernetics, IEEE Transactions on , (5):834–846, 1983.

Bloem and Bambos [2014] M. Bloem and N. Bambos. Infinite time horizon maximum causal entropy inverse reinforcement learning. In Decision and Control (CDC), 2014 IEEE 53rd Annual Conference on , pages 4911–4916. IEEE, 2014.

Boyd and Vandenberghe [2004] S. Boyd and L. Vandenberghe. Convex optimization . Cambridge university press, 2004.

Brockman et al. [2016] G. Brockman, V. Cheung, L. Pettersson, J. Schneider, J. Schulman, J. Tang, and W. Zaremba. OpenAI Gym. arXiv preprint arXiv:1606.01540 , 2016.

Cover and Thomas [2012] T. M. Cover and J. A. Thomas. Elements of information theory . John Wiley & Sons, 2012.

Finn et al. [2016] C. Finn, S. Levine, and P. Abbeel. Guided cost learning: Deep inverse optimal control via policy optimization. In Proceedings of the 33rd International Conference on Machine Learning , 2016.

Geramifard et al. [2015] A. Geramifard, C. Dann, R. H. Klein, W. Dabney, and J. P. How. Rlpy: A value-function-based reinforcement learning framework for education and research. JMLR , 2015.

Goodfellow et al. [2014] I. Goodfellow, J. Pouget-Abadie, M. Mirza, B. Xu, D. Warde-Farley, S. Ozair, A. Courville, and Y. Bengio. Generative adversarial nets. In NIPS , pages 2672–2680, 2014.

Hiriart-Urruty and Lemaréchal [1996] J.-B. Hiriart-Urruty and C. Lemaréchal. Convex Analysis and Minimization Algorithms , volume 305. Springer, 1996.

Ho et al. [2016] J. Ho, J. K. Gupta, and S. Ermon. Model-free imitation learning with policy optimization. In Proceedings of the 33rd International Conference on Machine Learning , 2016.

Kingma and Ba [2014] D. Kingma and J. Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980 , 2014.

Levine and Abbeel [2014] S. Levine and P. Abbeel. Learning neural network policies with guided policy search under unknown dynamics. In Advances in Neural Information Processing Systems , pages 1071–1079, 2014.

Levine and Koltun [2012] S. Levine and V. Koltun. Continuous inverse optimal control with locally optimal examples. In Proceedings of the 29th International Conference on Machine Learning , pages 41–48, 2012.

Levine et al. [2011] S. Levine, Z. Popovic, and V. Koltun. Nonlinear inverse reinforcement learning with gaussian processes. In Advances in Neural Information Processing Systems , pages 19–27, 2011.

Millar [1983] P. W. Millar. The minimax principle in asymptotic statistical theory. In Ecole d’Eté de Probabilités de Saint-Flour XI—1981 , pages 75–265. Springer, 1983.

Moore and Hall [1990] A. W. Moore and T. Hall. Efficient memory-based learning for robot control. 1990.

Ng and Russell [2000] A. Y. Ng and S. Russell. Algorithms for inverse reinforcement learning. In ICML , 2000.

Nguyen et al. [2009] X. Nguyen, M. J. Wainwright, and M. I. Jordan. On surrogate loss functions and f-divergences. The Annals of Statistics , pages 876–904, 2009.

Pomerleau [1991] D. A. Pomerleau. Efficient training of artificial neural networks for autonomous navigation. Neural Computation , 3(1):88–97, 1991.

Puterman [2014] M. L. Puterman. Markov decision processes: discrete stochastic dynamic programming . John Wiley & Sons, 2014.

Ratliff et al. [2009] N. D. Ratliff, D. Silver, and J. A. Bagnell. Learning to search: Functional gradient techniques for imitation learning. Autonomous Robots , 27(1):25–53, 2009.

Ross and Bagnell [2010] S. Ross and D. Bagnell. Efficient reductions for imitation learning. In AISTATS , pages 661–668, 2010.

Ross et al. [2011] S. Ross, G. J. Gordon, and D. Bagnell. A reduction of imitation learning and structured prediction to no-regret online learning. In AISTATS , pages 627–635, 2011.

Russell [1998] S. Russell. Learning agents for uncertain environments. In Proceedings of the Eleventh Annual Conference on Computational Learning Theory , pages 101–103. ACM, 1998.

Schulman et al. [2015a] J. Schulman, S. Levine, P. Abbeel, M. Jordan, and P. Moritz. Trust region policy optimization. In Proceedings of The 32nd International Conference on Machine Learning , pages 1889–1897, 2015a.

Schulman et al. [2015b] J. Schulman, P. Moritz, S. Levine, M. Jordan, and P. Abbeel. High-dimensional continuous control using generalized advantage estimation. arXiv preprint arXiv:1506.02438 , 2015b.

Syed and Schapire [2007] U. Syed and R. E. Schapire. A game-theoretic approach to apprenticeship learning. In Advances in Neural Information Processing Systems , pages 1449–1456, 2007.

Syed et al. [2008] U. Syed, M. Bowling, and R. E. Schapire. Apprenticeship learning using linear programming. In Proceedings of the 25th International Conference on Machine Learning , pages 1032–1039, 2008.

Todorov et al. [2012] E. Todorov, T. Erez, and Y. Tassa. Mujoco: A physics engine for model-based control. In Intelligent Robots and Systems (IROS), 2012 IEEE/RSJ International Conference on , pages 5026–5033. IEEE, 2012.

Ziebart et al. [2008] B. D. Ziebart, A. Maas, J. A. Bagnell, and A. K. Dey. Maximum entropy inverse reinforcement learning. In AAAI , AAAI’08, 2008.

Ziebart et al. [2010] B. D. Ziebart, J. A. Bagnell, and A. K. Dey. Modeling interaction via the principle of maximum causal entropy. In ICML , pages 1255–1262, 2010.

Appendix A Proofs

附录 A 证明

A.1 Proofs for Section 3

A.1 第 3 节的证明

Proof of Lemma 3.1.

First, we show strict concavity of Hˉ\bar{H}Hˉ. Let ρ\rhoρ and ρ′\rho^{\prime}ρ′ be occupancy measures, and suppose λ∈[0,1]\lambda\in[0,1]λ∈[0,1]. For all sss and aaa, the log-sum inequality [6] implies:

引理 3.1 的证明。

先证 Hˉ\bar{H}Hˉ 的严格凹性。令 ρ\rhoρ、ρ′\rho^{\prime}ρ′ 为占用测度,λ∈[0,1]\lambda\in[0,1]λ∈[0,1]。对所有 sss、aaa,对数和不等式 [6] 给出:

−(λρ(s,a)+(1−λ)ρ′(s,a))log⁡λρ(s,a)+(1−λ)ρ′(s,a)∑a′(λρ(s,a′)+(1−λ)ρ′(s,a′))=−(λρ(s,a)+(1−λ)ρ′(s,a))log⁡λρ(s,a)+(1−λ)ρ′(s,a)λ∑a′ρ(s,a′)+(1−λ)∑a′ρ′(s,a′)≥−λρ(s,a)log⁡λρ(s,a)λ∑a′ρ(s,a′)−(1−λ)ρ′(s,a)log⁡(1−λ)ρ′(s,a)(1−λ)∑a′ρ′(s,a′)=λ(−ρ(s,a)log⁡ρ(s,a)∑a′ρ(s,a′))+(1−λ)(−ρ′(s,a)log⁡ρ′(s,a)∑a′ρ′(s,a′)),(19)\displaystyle- \\ \displaystyle(\lambda\rho(s,a)+(1-\lambda)\rho^{\prime}(s,a))\log\frac{\lambda\rho(s,a)+(1-\lambda)\rho^{\prime}(s,a)}{\sum_{a^{\prime}}(\lambda\rho(s,a^{\prime})+(1-\lambda)\rho^{\prime}(s,a^{\prime}))} \\ \displaystyle=-(\lambda\rho(s,a)+(1-\lambda)\rho^{\prime}(s,a))\log\frac{\lambda\rho(s,a)+(1-\lambda)\rho^{\prime}(s,a)}{\lambda\sum_{a^{\prime}}\rho(s,a^{\prime})+(1-\lambda)\sum_{a^{\prime}}\rho^{\prime}(s,a^{\prime})} \\ \displaystyle\geq-\lambda\rho(s,a)\log\frac{\lambda\rho(s,a)}{\lambda\sum_{a^{\prime}}\rho(s,a^{\prime})}-(1-\lambda)\rho^{\prime}(s,a)\log\frac{(1-\lambda)\rho^{\prime}(s,a)}{(1-\lambda)\sum_{a^{\prime}}\rho^{\prime}(s,a^{\prime})} \\ \displaystyle=\lambda\left(-\rho(s,a)\log\frac{\rho(s,a)}{\sum_{a^{\prime}}\rho(s,a^{\prime})}\right)+(1-\lambda)\left(-\rho^{\prime}(s,a)\log\frac{\rho^{\prime}(s,a)}{\sum_{a^{\prime}}\rho^{\prime}(s,a^{\prime})}\right), \tag{19}−(λρ(s,a)+(1−λ)ρ′(s,a))log∑a′​(λρ(s,a′)+(1−λ)ρ′(s,a′))λρ(s,a)+(1−λ)ρ′(s,a)​=−(λρ(s,a)+(1−λ)ρ′(s,a))logλ∑a′​ρ(s,a′)+(1−λ)∑a′​ρ′(s,a′)λρ(s,a)+(1−λ)ρ′(s,a)​≥−λρ(s,a)logλ∑a′​ρ(s,a′)λρ(s,a)​−(1−λ)ρ′(s,a)log(1−λ)∑a′​ρ′(s,a′)(1−λ)ρ′(s,a)​=λ(−ρ(s,a)log∑a′​ρ(s,a′)ρ(s,a)​)+(1−λ)(−ρ′(s,a)log∑a′​ρ′(s,a′)ρ′(s,a)​),(19)

with equality if and only if πρ≜ρ(s,a)/∑a′ρ(s,a′)=ρ′(s,a)/∑a′ρ′(s,a′)≜πρ′\pi_{\rho}\triangleq\rho(s,a)/\sum_{a^{\prime}}\rho(s,a^{\prime})=\rho^{\prime}(s,a)/\sum_{a^{\prime}}\rho^{\prime}(s,a^{\prime})\triangleq\pi_{\rho^{\prime}}πρ​≜ρ(s,a)/∑a′​ρ(s,a′)=ρ′(s,a)/∑a′​ρ′(s,a′)≜πρ′​. Summing both sides over all sss and aaa shows that Hˉ(λρ+(1−λ)ρ′)≥λHˉ(ρ)+(1−λ)Hˉ(ρ′)\bar{H}(\lambda\rho+(1-\lambda)\rho^{\prime})\geq\lambda\bar{H}(\rho)+(1-\lambda)\bar{H}(\rho^{\prime})Hˉ(λρ+(1−λ)ρ′)≥λHˉ(ρ)+(1−λ)Hˉ(ρ′) with equality if and only if πρ=πρ′\pi_{\rho}=\pi_{\rho^{\prime}}πρ​=πρ′​. Applying Proposition 3.1 shows that equality in fact holds if and only if ρ=ρ′\rho=\rho^{\prime}ρ=ρ′, so Hˉ\bar{H}Hˉ is strictly concave.

当且仅当 πρ≜ρ(s,a)/∑a′ρ(s,a′)=ρ′(s,a)/∑a′ρ′(s,a′)≜πρ′\pi_{\rho}\triangleq\rho(s,a)/\sum_{a^{\prime}}\rho(s,a^{\prime})=\rho^{\prime}(s,a)/\sum_{a^{\prime}}\rho^{\prime}(s,a^{\prime})\triangleq\pi_{\rho^{\prime}}πρ​≜ρ(s,a)/∑a′​ρ(s,a′)=ρ′(s,a)/∑a′​ρ′(s,a′)≜πρ′​ 时等号成立。两边对所有 sss、aaa 求和得 Hˉ(λρ+(1−λ)ρ′)≥λHˉ(ρ)+(1−λ)Hˉ(ρ′)\bar{H}(\lambda\rho+(1-\lambda)\rho^{\prime})\geq\lambda\bar{H}(\rho)+(1-\lambda)\bar{H}(\rho^{\prime})Hˉ(λρ+(1−λ)ρ′)≥λHˉ(ρ)+(1−λ)Hˉ(ρ′),等号当且仅当 πρ=πρ′\pi_{\rho}=\pi_{\rho^{\prime}}πρ​=πρ′​。再由命题 3.1,等号实际当且仅当 ρ=ρ′\rho=\rho^{\prime}ρ=ρ′,故 Hˉ\bar{H}Hˉ 严格凹。

Now, we turn to verifying the last two statements, which also follow from Proposition 3.1 and the definition of occupancy measures. First,

再验证后两句,它们同样由命题 3.1 与占用测度定义推出。首先,

H(π)=Eπ[−log⁡π(a∣s)]=−∑s,aρπ(s,a)log⁡π(a∣s)=−∑s,aρπ(s,a)log⁡ρπ(s,a)∑a′ρπ(s,a′)=Hˉ(ρπ),Hˉ(ρ)=−∑s,aρ(s,a)log⁡ρ(s,a)∑a′ρ(s,a′)=−∑s,aρπρ(s,a)log⁡πρ(a∣s)=Eπρ[−log⁡πρ(a∣s)]=H(πρ).(23)\displaystyle H(\pi) \\ \displaystyle=\mathbb{E}_{\pi}[-\log\pi(a|s)] \\ \displaystyle=-\sum_{s,a}\rho_{\pi}(s,a)\log\pi(a|s) \\ \displaystyle=-\sum_{s,a}\rho_{\pi}(s,a)\log\frac{\rho_{\pi}(s,a)}{\sum_{a^{\prime}}\rho_{\pi}(s,a^{\prime})} \\ \displaystyle=\bar{H}(\rho_{\pi}), \\ \displaystyle\bar{H}(\rho) \\ \displaystyle=-\sum_{s,a}\rho(s,a)\log\frac{\rho(s,a)}{\sum_{a^{\prime}}\rho(s,a^{\prime})} \\ \displaystyle=-\sum_{s,a}\rho_{\pi_{\rho}}(s,a)\log\pi_{\rho}(a|s) \\ \displaystyle=\mathbb{E}_{\pi_{\rho}}[-\log\pi_{\rho}(a|s)] \\ \displaystyle=H(\pi_{\rho}). \tag{23}H(π)=Eπ​[−logπ(a∣s)]=−s,a∑​ρπ​(s,a)logπ(a∣s)=−s,a∑​ρπ​(s,a)log∑a′​ρπ​(s,a′)ρπ​(s,a)​=Hˉ(ρπ​),Hˉ(ρ)=−s,a∑​ρ(s,a)log∑a′​ρ(s,a′)ρ(s,a)​=−s,a∑​ρπρ​​(s,a)logπρ​(a∣s)=Eπρ​​[−logπρ​(a∣s)]=H(πρ​).(23)

∎

Proof of Proposition 3.2.

This proof relies on properties of saddle points. For a reference, we refer the reader to Hiriart-Urruty and Lemaréchal 1996.

命题 3.2 的证明。

本证明依赖鞍点性质。参考文献见 Hiriart-Urruty 与 Lemaréchal 1996。

Let c~∈\irlψ(πE)\tilde{c}\in\irl_{\psi}(\pi_{E})c~∈\irlψ​(πE​), π~∈\rl(c~)=\rl∘\irlψ(πE)\tilde{\pi}\in\rl(\tilde{c})=\rl\circ\irl_{\psi}(\pi_{E})π~∈\rl(c~)=\rl∘\irlψ​(πE​), and

令 c~∈\irlψ(πE)\tilde{c}\in\irl_{\psi}(\pi_{E})c~∈\irlψ​(πE​),π~∈\rl(c~)=\rl∘\irlψ(πE)\tilde{\pi}\in\rl(\tilde{c})=\rl\circ\irl_{\psi}(\pi_{E})π~∈\rl(c~)=\rl∘\irlψ​(πE​),以及

πA∈arg min⁡π−H(π)+ψ∗(ρπ−ρπE)=arg min⁡πmax⁡c−H(π)−ψ(c)+∑s,a(ρπ(s,a)−ρπE(s,a))c(s,a)(31)\displaystyle\pi_{A} \\ \displaystyle\in\argmin_{\pi}-H(\pi)+\psi^{*}(\rho_{\pi}-\rho_{\pi_{E}}) \\ \displaystyle=\argmin_{\pi}\max_{c}-H(\pi)-\psi(c)+\sum_{s,a}(\rho_{\pi}(s,a)-\rho_{\pi_{E}}(s,a))c(s,a) \tag{31}πA​∈πargmin​−H(π)+ψ∗(ρπ​−ρπE​​)=πargmin​cmax​−H(π)−ψ(c)+s,a∑​(ρπ​(s,a)−ρπE​​(s,a))c(s,a)(31)

We wish to show that πA=π~\pi_{A}=\tilde{\pi}πA​=π~. To do this, let ρA\rho_{A}ρA​ be the occupancy measure of πA\pi_{A}πA​, let ρ~\tilde{\rho}ρ~​ be the occupancy measure of π~\tilde{\pi}π~, and define Lˉ:D×RS×A→R\bar{L}:\mathcal{D}\times\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\mathbb{R}Lˉ:D×RS×A→R by

我们要证 πA=π~\pi_{A}=\tilde{\pi}πA​=π~。为此令 ρA\rho_{A}ρA​ 为 πA\pi_{A}πA​ 的占用测度,ρ~\tilde{\rho}ρ~​ 为 π~\tilde{\pi}π~ 的占用测度,并定义 Lˉ:D×RS×A→R\bar{L}:\mathcal{D}\times\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\mathbb{R}Lˉ:D×RS×A→R 为

Lˉ(ρ,c)=−Hˉ(ρ)−ψ(c)+∑s,aρ(s,a)c(s,a)−∑s,aρπE(s,a)c(s,a).(33)\displaystyle\bar{L}(\rho,c) \\ \displaystyle=-\bar{H}(\rho)-\psi(c)+\sum_{s,a}\rho(s,a)c(s,a)-\sum_{s,a}\rho_{\pi_{E}}(s,a)c(s,a). \tag{33}Lˉ(ρ,c)=−Hˉ(ρ)−ψ(c)+s,a∑​ρ(s,a)c(s,a)−s,a∑​ρπE​​(s,a)c(s,a).(33)

The following relationships then hold, due to Proposition 3.1:

由命题 3.1,有如下关系:

ρA∈arg min⁡ρ∈Dmax⁡cLˉ(ρ,c),c~∈arg max⁡cmin⁡ρ∈DLˉ(ρ,c),ρ~∈arg min⁡ρ∈DLˉ(ρ,c~).(34)\displaystyle\rho_{A} \\ \displaystyle\in\argmin_{\rho\in\mathcal{D}}\max_{c}\bar{L}(\rho,c), \\ \displaystyle\tilde{c} \\ \displaystyle\in\argmax_{c}\min_{\rho\in\mathcal{D}}\bar{L}(\rho,c), \\ \displaystyle\tilde{\rho} \\ \displaystyle\in\argmin_{\rho\in\mathcal{D}}\bar{L}(\rho,\tilde{c}). \tag{34}ρA​∈ρ∈Dargmin​cmax​Lˉ(ρ,c),c~∈cargmax​ρ∈Dmin​Lˉ(ρ,c),ρ~​∈ρ∈Dargmin​Lˉ(ρ,c~).(34)

Now D\mathcal{D}D is compact and convex and RS×A\mathbb{R}^{\mathcal{S}\times\mathcal{A}}RS×A is convex; furthermore, due to convexity of −Hˉ-\bar{H}−Hˉ and ψ\psiψ, we also have that Lˉ(⋅,c)\bar{L}(\cdot,c)Lˉ(⋅,c) is convex for all ccc, and that Lˉ(ρ,⋅)\bar{L}(\rho,\cdot)Lˉ(ρ,⋅) is concave for all ρ\rhoρ. Therefore, we can use minimax duality [16]:

现 D\mathcal{D}D 紧且凸,RS×A\mathbb{R}^{\mathcal{S}\times\mathcal{A}}RS×A 凸;又因 −Hˉ-\bar{H}−Hˉ 与 ψ\psiψ 凸,Lˉ(⋅,c)\bar{L}(\cdot,c)Lˉ(⋅,c) 对一切 ccc 凸,Lˉ(ρ,⋅)\bar{L}(\rho,\cdot)Lˉ(ρ,⋅) 对一切 ρ\rhoρ 凹。因此可用极小极大对偶 [16]:

min⁡ρ∈Dmax⁡c∈CLˉ(ρ,c)=max⁡c∈Cmin⁡ρ∈DLˉ(ρ,c)(37)\displaystyle\min_{\rho\in\mathcal{D}}\max_{c\in\mathcal{C}}\bar{L}(\rho,c)=\max_{c\in\mathcal{C}}\min_{\rho\in\mathcal{D}}\bar{L}(\rho,c) \tag{37}ρ∈Dmin​c∈Cmax​Lˉ(ρ,c)=c∈Cmax​ρ∈Dmin​Lˉ(ρ,c)(37)

Hence, from Eqs. 34 and 35, (ρA,c~)(\rho_{A},\tilde{c})(ρA​,c~) is a saddle point of Lˉ\bar{L}Lˉ, which implies that

于是由式 (34)(35),((ρA,c~)((\rho_{A},\tilde{c})((ρA​,c~) 是 Lˉ\bar{L}Lˉ 的鞍点,从而

ρA∈arg min⁡ρ∈DLˉ(ρ,c~).(38)\displaystyle\rho_{A}\in\argmin_{\rho\in\mathcal{D}}\bar{L}(\rho,\tilde{c}). \tag{38}ρA​∈ρ∈Dargmin​Lˉ(ρ,c~).(38)

Because Lˉ(⋅,c)\bar{L}(\cdot,c)Lˉ(⋅,c) is strictly convex for all ccc (Lemma 3.1), Eqs. 38 and 36 imply ρA=ρ~\rho_{A}=\tilde{\rho}ρA​=ρ~​. Since policies corresponding to occupancy measures are unique (Proposition 3.1), we get πA=π~\pi_{A}=\tilde{\pi}πA​=π~. ∎

因为对一切 ccc,Lˉ(⋅,c)\bar{L}(\cdot,c)Lˉ(⋅,c) 严格凸(引理 3.1),式 (38) 与 (36) 推出 ρA=ρ~\rho_{A}=\tilde{\rho}ρA​=ρ~​。占用测度对应的策略唯一(命题 3.1),故 πA=π~\pi_{A}=\tilde{\pi}πA​=π~。∎

A.2 Proofs for Section 5

A.2 第 5 节的证明

In Eq. 13 of Section 5, we described a cost regularizer ψGA\psi_{\text{GA}}ψGA​, which leads to an imitation learning algorithm 15 that minimizes Jensen-Shannon divergence between occupancy measures. To justify our choice of ψGA\psi_{\text{GA}}ψGA​, we show how to convert certain surrogate loss functions ϕ\phiϕ, for binary classification of state-action pairs drawn from the occupancy measures ρπ\rho_{\pi}ρπ​ and ρπE\rho_{\pi_{E}}ρπE​​, into cost function regularizers ψ\psiψ, for which ψ∗(ρπ−ρπE)\psi^{*}(\rho_{\pi}-\rho_{\pi_{E}})ψ∗(ρπ​−ρπE​​) is the minimum expected risk Rϕ(ρπ,ρπE)R_{\phi}(\rho_{\pi},\rho_{\pi_{E}})Rϕ​(ρπ​,ρπE​​) for ϕ\phiϕ:

第 5 节式 (13) 给出代价正则项 ψGA\psi_{\text{GA}}ψGA​,它导致最小化占用测度间 Jensen–Shannon 散度的模仿学习算法 (15)。为说明这一选择,我们展示如何把某些替代损失 ϕ\phiϕ(用于对来自占用测度 ρπ\rho_{\pi}ρπ​ 与 ρπE\rho_{\pi_{E}}ρπE​​ 的状态–动作对做二分类)转换成代价正则项 ψ\psiψ,使得 ψ∗(ρπ−ρπE)\psi^{*}(\rho_{\pi}-\rho_{\pi_{E}})ψ∗(ρπ​−ρπE​​) 恰为 ϕ\phiϕ 的最小期望风险 Rϕ(ρπ,ρπE)R_{\phi}(\rho_{\pi},\rho_{\pi_{E}})Rϕ​(ρπ​,ρπE​​):

Rϕ(π,πE)=∑s,amin⁡γ∈R ρπ(s,a)ϕ(γ)+ρπE(s,a)ϕ(−γ)(39)\displaystyle R_{\phi}(\pi,\pi_{E}) \\ \displaystyle=\sum_{s,a}\min_{\gamma\in\mathbb{R}}\ \rho_{\pi}(s,a)\phi(\gamma)+\rho_{\pi_{E}}(s,a)\phi(-\gamma) \tag{39}Rϕ​(π,πE​)=s,a∑​γ∈Rmin​ ρπ​(s,a)ϕ(γ)+ρπE​​(s,a)ϕ(−γ)(39)

Specifically, we will restrict ourselves to strictly decreasing convex loss functions. Nguyen et al. 2009 show a correspondence between minimum expected risks RϕR_{\phi}Rϕ​ and fff-divergences, of which Jensen-Shannon divergence is a special case. Our following construction, therefore, can generate any imitation learning algorithm that minimizes an fff-divergence between occupancy measures, as long as that fff-divergence is induced by a strictly decreasing convex surrogate ϕ\phiϕ.

具体地,我们限制在严格递减的凸损失函数。Nguyen 等人 2009 给出了最小期望风险 RϕR_{\phi}Rϕ​ 与 fff-散度(Jensen–Shannon 是其特例)之间的对应。因此,只要 fff-散度由严格递减凸替代 ϕ\phiϕ 诱导,下述构造就能生成最小化占用测度间该 fff-散度的任意模仿学习算法。

Proposition A.1.

Suppose ϕ:R→R\phi:\mathbb{R}\rightarrow\mathbb{R}ϕ:R→R is a strictly decreasing convex function. Let TTT be the range of −ϕ-\phi−ϕ, and define gϕ:R→R‾g_{\phi}:\mathbb{R}\rightarrow\overline{\mathbb{R}}gϕ​:R→R and ψϕ:RS×A→R‾\psi_{\phi}:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}ψϕ​:RS×A→R by:

命题 A.1。

设 ϕ:R→R\phi:\mathbb{R}\rightarrow\mathbb{R}ϕ:R→R 严格递减且凸。令 TTT 为 −ϕ-\phi−ϕ 的值域,并定义 gϕ:R→R‾g_{\phi}:\mathbb{R}\rightarrow\overline{\mathbb{R}}gϕ​:R→R 与 ψϕ:RS×A→R‾\psi_{\phi}:\mathbb{R}^{\mathcal{S}\times\mathcal{A}}\rightarrow\overline{\mathbb{R}}ψϕ​:RS×A→R 为:

$\displaystyle\begin{split}g_{\phi}(x)&=\begin{cases}-x+\phi(-\phi^{-1}(-x))&ifx\in T$\
+\infty&otherwise\end{cases}\
\psi_{\phi}(c)&=\begin{cases}\sum_{s,a}\rho_{\pi_{E}}(s,a)g_{\phi}(c(s,a))&if c(s,a)∈Tc(s,a)\in Tc(s,a)∈T for all s,as,as,a\
+\infty&otherwise\end{cases}\end{split} \tag{40}$$

Then, ψϕ\psi_{\phi}ψϕ​ is closed, proper, and convex, and \rl∘\irlψϕ(πE)=arg min⁡π−H(π)−Rϕ(ρπ,ρπE){\rl\circ\irl_{\psi_{\phi}}(\pi_{E})=\argmin_{\pi}-H(\pi)-R_{\phi}(\rho_{\pi},\rho_{\pi_{E}})}\rl∘\irlψϕ​​(πE​)=argminπ​−H(π)−Rϕ​(ρπ​,ρπE​​).

则 ψϕ\psi_{\phi}ψϕ​ 闭、固有且凸,且 \rl∘\irlψϕ(πE)=arg min⁡π−H(π)−Rϕ(ρπ,ρπE){\rl\circ\irl_{\psi_{\phi}}(\pi_{E})=\argmin_{\pi}-H(\pi)-R_{\phi}(\rho_{\pi},\rho_{\pi_{E}})}\rl∘\irlψϕ​​(πE​)=argminπ​−H(π)−Rϕ​(ρπ​,ρπE​​)。

Proof.

To verify the first claim, it suffices to check that gϕ(x)=−x+ϕ(−ϕ−1(−x))g_{\phi}(x)=-x+\phi(-\phi^{-1}(-x))gϕ​(x)=−x+ϕ(−ϕ−1(−x)) is closed, proper, and convex. Convexity follows from the fact that x↦ϕ(−ϕ−1(−x))x\mapsto\phi(-\phi^{-1}(-x))x↦ϕ(−ϕ−1(−x)) is convex, because it is a concave function followed by a nonincreasing convex function. Furthermore, because TTT is nonempty, gϕg_{\phi}gϕ​ is proper. To show that gϕg_{\phi}gϕ​ is closed, note that because ϕ\phiϕ is strictly decreasing and convex, the range of ϕ\phiϕ is either all of R\mathbb{R}R or an open interval (b,∞)(b,\infty)(b,∞) for some b∈Rb\in\mathbb{R}b∈R. If the range of ϕ\phiϕ is R\mathbb{R}R, then gϕg_{\phi}gϕ​ is finite everywhere and is therefore closed. On the other hand, if the range of ϕ\phiϕ is (b,∞)(b,\infty)(b,∞), then ϕ(x)→b\phi(x)\rightarrow bϕ(x)→b as x→∞x\rightarrow\inftyx→∞, and ϕ(x)→∞\phi(x)\rightarrow\inftyϕ(x)→∞ as x→−∞x\rightarrow-\inftyx→−∞. Thus, as x→bx\rightarrow bx→b, ϕ−1(−x)→∞\phi^{-1}(-x)\rightarrow\inftyϕ−1(−x)→∞, so ϕ(−ϕ−1(−x))→∞\phi(-\phi^{-1}(-x))\rightarrow\inftyϕ(−ϕ−1(−x))→∞ too, implying that gϕ(x)→∞g_{\phi}(x)\rightarrow\inftygϕ​(x)→∞ as x→bx\rightarrow bx→b, which means gϕg_{\phi}gϕ​ is closed.

证明。

验证第一句只需检查 gϕ(x)=−x+ϕ(−ϕ−1(−x))g_{\phi}(x)=-x+\phi(-\phi^{-1}(-x))gϕ​(x)=−x+ϕ(−ϕ−1(−x)) 闭、固有且凸。凸性来自 x↦ϕ(−ϕ−1(−x))x\mapsto\phi(-\phi^{-1}(-x))x↦ϕ(−ϕ−1(−x)) 是凸函数:它是凹函数后再接非增凸函数。又因 TTT 非空,gϕg_{\phi}gϕ​ 固有。证明闭性:因 ϕ\phiϕ 严格递减且凸,其值域要么是全体 R\mathbb{R}R,要么是某开区间 (b,∞)(b,\infty)(b,∞)(b∈Rb\in\mathbb{R}b∈R)。若值域为 R\mathbb{R}R,则 gϕg_{\phi}gϕ​ 处处有限因而闭。若值域为 (b,∞)(b,\infty)(b,∞),则 x→∞x\rightarrow\inftyx→∞ 时 ϕ(x)→b\phi(x)\rightarrow bϕ(x)→b,x→−∞x\rightarrow-\inftyx→−∞ 时 ϕ(x)→∞\phi(x)\rightarrow\inftyϕ(x)→∞。于是 x→bx\rightarrow bx→b 时 ϕ−1(−x)→∞\phi^{-1}(-x)\rightarrow\inftyϕ−1(−x)→∞,从而 ϕ(−ϕ−1(−x))→∞\phi(-\phi^{-1}(-x))\rightarrow\inftyϕ(−ϕ−1(−x))→∞,即 gϕ(x)→∞g_{\phi}(x)\rightarrow\inftygϕ​(x)→∞,故 gϕg_{\phi}gϕ​ 闭。

Now, we verify the second claim. By Proposition 3.2, all we need to check is that −Rϕ(ρπ,ρπE)=ψϕ∗(ρπ−ρπE)-R_{\phi}(\rho_{\pi},\rho_{\pi_{E}})=\psi_{\phi}^{*}(\rho_{\pi}-\rho_{\pi_{E}})−Rϕ​(ρπ​,ρπE​​)=ψϕ∗​(ρπ​−ρπE​​):

再验证第二句。由命题 3.2,只需检查 −Rϕ(ρπ,ρπE)=ψϕ∗(ρπ−ρπE)-R_{\phi}(\rho_{\pi},\rho_{\pi_{E}})=\psi_{\phi}^{*}(\rho_{\pi}-\rho_{\pi_{E}})−Rϕ​(ρπ​,ρπE​​)=ψϕ∗​(ρπ​−ρπE​​):

ψϕ∗(ρπ−ρπE)=max⁡c∈C∑s,a(ρπ(s,a)−ρπE(s,a))c(s,a)−∑s,aρπE(s,a)gϕ(c(s,a))=∑s,amax⁡c∈T (ρπ(s,a)−ρπE(s,a))c−ρπE(s,a)[−c+ϕ(−ϕ−1(−c))]=∑s,amax⁡c∈T ρπ(s,a)c−ρπE(s,a)ϕ(−ϕ−1(−c))=∑s,amax⁡γ∈R ρπ(s,a)(−ϕ(γ))−ρπE(s,a)ϕ(−ϕ−1(ϕ(γ)))=∑s,amax⁡γ∈R ρπ(s,a)(−ϕ(γ))−ρπE(s,a)ϕ(−γ)=−Rϕ(ρπ,ρπE)(41)\displaystyle\psi_{\phi}^{*}(\rho_{\pi}-\rho_{\pi_{E}}) \\ \displaystyle=\max_{c\in\mathcal{C}}\sum_{s,a}(\rho_{\pi}(s,a)-\rho_{\pi_{E}}(s,a))c(s,a)-\sum_{s,a}\rho_{\pi_{E}}(s,a)g_{\phi}(c(s,a)) \\ \displaystyle=\sum_{s,a}\max_{c\in T}\ (\rho_{\pi}(s,a)-\rho_{\pi_{E}}(s,a))c-\rho_{\pi_{E}}(s,a)[-c+\phi(-\phi^{-1}(-c))] \\ \displaystyle=\sum_{s,a}\max_{c\in T}\ \rho_{\pi}(s,a)c-\rho_{\pi_{E}}(s,a)\phi(-\phi^{-1}(-c)) \\ \displaystyle=\sum_{s,a}\max_{\gamma\in\mathbb{R}}\ \rho_{\pi}(s,a)(-\phi(\gamma))-\rho_{\pi_{E}}(s,a)\phi(-\phi^{-1}(\phi(\gamma))) \\ \displaystyle=\sum_{s,a}\max_{\gamma\in\mathbb{R}}\ \rho_{\pi}(s,a)(-\phi(\gamma))-\rho_{\pi_{E}}(s,a)\phi(-\gamma) \\ \displaystyle=-R_{\phi}(\rho_{\pi},\rho_{\pi_{E}}) \tag{41}ψϕ∗​(ρπ​−ρπE​​)=c∈Cmax​s,a∑​(ρπ​(s,a)−ρπE​​(s,a))c(s,a)−s,a∑​ρπE​​(s,a)gϕ​(c(s,a))=s,a∑​c∈Tmax​ (ρπ​(s,a)−ρπE​​(s,a))c−ρπE​​(s,a)[−c+ϕ(−ϕ−1(−c))]=s,a∑​c∈Tmax​ ρπ​(s,a)c−ρπE​​(s,a)ϕ(−ϕ−1(−c))=s,a∑​γ∈Rmax​ ρπ​(s,a)(−ϕ(γ))−ρπE​​(s,a)ϕ(−ϕ−1(ϕ(γ)))=s,a∑​γ∈Rmax​ ρπ​(s,a)(−ϕ(γ))−ρπE​​(s,a)ϕ(−γ)=−Rϕ​(ρπ​,ρπE​​)(41)

where we made the change of variables c→−ϕ(γ)c\rightarrow-\phi(\gamma)c→−ϕ(γ), justified because TTT is the range of −ϕ-\phi−ϕ. ∎

其中做了变量替换 c→−ϕ(γ)c\rightarrow-\phi(\gamma)c→−ϕ(γ),因 TTT 是 −ϕ-\phi−ϕ 的值域。∎

Having showed how to construct a cost function regularizer ψϕ\psi_{\phi}ψϕ​ from ϕ\phiϕ, we obtain, as a corollary, a cost function regularizer for the logistic loss, whose optimal expected risk is, up to a constant, the Jensen-Shannon divergence.

既已说明如何从 ϕ\phiϕ 构造代价正则 ψϕ\psi_{\phi}ψϕ​,作为推论,我们得到 logistic 损失对应的代价正则;其最优期望风险(差一个常数)正是 Jensen–Shannon 散度。

Corollary A.1.1.

The cost regularizer 13

推论 A.1.1。

代价正则项 (13)

$\displaystyle\psi_{\text{GA}}(c)\triangleq\begin{cases}\mathbb{E}_{\pi_{E}}[g(c(s,a))]&ifc<0$\
+\infty&otherwise\end{cases}\quad\text{where}\quad g(x)=\begin{cases}-x-\log(1-e^{x})&if x<0x<0x<0\
+\infty&otherwise\end{cases}$$

satisfies

满足

ψGA∗(ρπ−ρπE)=max⁡D∈(0,1)S×AEπ[log⁡(D(s,a))]+EπE[log⁡(1−D(s,a))].(47)\displaystyle\psi_{\text{GA}}^{*}(\rho_{\pi}-\rho_{\pi_{E}})=\max_{D\in(0,1)^{\mathcal{S}\times\mathcal{A}}}\mathbb{E}_{\pi}[\log(D(s,a))]+\mathbb{E}_{\pi_{E}}[\log(1-D(s,a))]. \tag{47}ψGA∗​(ρπ​−ρπE​​)=D∈(0,1)S×Amax​Eπ​[log(D(s,a))]+EπE​​[log(1−D(s,a))].(47)

Proof.

Using the logistic loss ϕ(x)=log⁡(1+e−x)\phi(x)=\log(1+e^{-x})ϕ(x)=log(1+e−x), we see that Eq. 40 reduces to the claimed ψGA\psi_{\text{GA}}ψGA​. Applying Proposition A.1, we get

证明。

取 logistic 损失 ϕ(x)=log⁡(1+e−x)\phi(x)=\log(1+e^{-x})ϕ(x)=log(1+e−x),式 (40) 即化为所述 ψGA\psi_{\text{GA}}ψGA​。应用命题 A.1 得

ψGA∗(ρπ−ρπE)=−Rϕ(ρπ,ρπE)=∑s,amax⁡γ∈R ρπ(s,a)log⁡(11+e−γ)+ρπE(s,a)log⁡(11+eγ)=∑s,amax⁡γ∈R ρπ(s,a)log⁡(11+e−γ)+ρπE(s,a)log⁡(1−11+e−γ)=∑s,amax⁡γ∈R ρπ(s,a)log⁡(σ(γ))+ρπE(s,a)log⁡(1−σ(γ)),σ(x)=1/(1+e−x)σ(0,1)ψGA∗(ρπ−ρπE)=∑s,amax⁡d∈(0,1) ρπ(s,a)log⁡d+ρπE(s,a)log⁡(1−d)=max⁡D∈(0,1)S×A ∑s,aρπ(s,a)log⁡(D(s,a))+ρπE(s,a)log⁡(1−D(s,a)),(48)\displaystyle\psi_{\text{GA}}^{*}(\rho_{\pi}-\rho_{\pi_{E}}) \\ \displaystyle=-R_{\phi}(\rho_{\pi},\rho_{\pi_{E}}) \\ \displaystyle=\sum_{s,a}\max_{\gamma\in\mathbb{R}}\ \rho_{\pi}(s,a)\log\left(\frac{1}{1+e^{-\gamma}}\right)+\rho_{\pi_{E}}(s,a)\log\left(\frac{1}{1+e^{\gamma}}\right) \\ \displaystyle=\sum_{s,a}\max_{\gamma\in\mathbb{R}}\ \rho_{\pi}(s,a)\log\left(\frac{1}{1+e^{-\gamma}}\right)+\rho_{\pi_{E}}(s,a)\log\left(1-\frac{1}{1+e^{-\gamma}}\right) \\ \displaystyle=\sum_{s,a}\max_{\gamma\in\mathbb{R}}\ \rho_{\pi}(s,a)\log(\sigma(\gamma))+\rho_{\pi_{E}}(s,a)\log(1-\sigma(\gamma)), \\ \sigma(x)=1/(1+e^{-x}) \\ \sigma \\ (0,1) \\ \displaystyle\psi_{\text{GA}}^{*}(\rho_{\pi}-\rho_{\pi_{E}}) \\ \displaystyle=\sum_{s,a}\max_{d\in(0,1)}\ \rho_{\pi}(s,a)\log d+\rho_{\pi_{E}}(s,a)\log(1-d) \\ \displaystyle=\max_{D\in(0,1)^{\mathcal{S}\times\mathcal{A}}}\ \sum_{s,a}\rho_{\pi}(s,a)\log(D(s,a))+\rho_{\pi_{E}}(s,a)\log(1-D(s,a)), \tag{48}ψGA∗​(ρπ​−ρπE​​)=−Rϕ​(ρπ​,ρπE​​)=s,a∑​γ∈Rmax​ ρπ​(s,a)log(1+e−γ1​)+ρπE​​(s,a)log(1+eγ1​)=s,a∑​γ∈Rmax​ ρπ​(s,a)log(1+e−γ1​)+ρπE​​(s,a)log(1−1+e−γ1​)=s,a∑​γ∈Rmax​ ρπ​(s,a)log(σ(γ))+ρπE​​(s,a)log(1−σ(γ)),σ(x)=1/(1+e−x)σ(0,1)ψGA∗​(ρπ​−ρπE​​)=s,a∑​d∈(0,1)max​ ρπ​(s,a)logd+ρπE​​(s,a)log(1−d)=D∈(0,1)S×Amax​ s,a∑​ρπ​(s,a)log(D(s,a))+ρπE​​(s,a)log(1−D(s,a)),(48)

which is the desired expression. ∎

此即所需表达式。∎

We conclude with a policy gradient formula for causal entropy.

最后给出因果熵的策略梯度公式。

Lemma A.1.

The causal entropy gradient is given by

引理 A.1。

因果熵梯度为

$$\displaystyle\begin{split}\nabla_{\theta}\mathbb{E}{\pi{\theta}}[-\log\pi_{\theta}(a|s)]&=\mathbb{E}{\pi{\theta}}\left[\nabla_{\theta}\log\pi_{\theta}(a|s)Q_{\mathrm{log}}(s,a)\right],\
\text{where}\quad Q_{\mathrm{log}}(\bar{s},\bar{a})&=\mathbb{E}{\pi{\theta}}[-\log\pi_{\theta}(a|s),|,s_{0}=\bar{s},a_{0}=\bar{a}].\end{split} \tag{54}$$

Proof.

For an occupancy measure ρ(s,a)\rho(s,a)ρ(s,a), define ρ(s)=∑aρ(s,a)\rho(s)=\sum_{a}\rho(s,a)ρ(s)=∑a​ρ(s,a). Next,

证明。

对占用测度 ρ(s,a)\rho(s,a)ρ(s,a),定义 ρ(s)=∑aρ(s,a)\rho(s)=\sum_{a}\rho(s,a)ρ(s)=∑a​ρ(s,a)。接着,

∇θEπθ[−log⁡πθ(a∣s)]=−∇θ∑s,aρπθ(s,a)log⁡πθ(a∣s)=−∑s,a(∇θρπθ(s,a))log⁡πθ(a∣s)−∑sρπθ(s)∑aπθ(a∣s)∇θlog⁡πθ(a∣s)=−∑s,a(∇θρπθ(s,a))log⁡πθ(a∣s)−∑sρπθ(s)∑a∇θπθ(a∣s)\displaystyle\nabla_{\theta}\mathbb{E}_{\pi_{\theta}}[-\log\pi_{\theta}(a|s)] \\ \displaystyle=-\nabla_{\theta}\sum_{s,a}\rho_{\pi_{\theta}}(s,a)\log\pi_{\theta}(a|s) \\ \displaystyle=-\sum_{s,a}(\nabla_{\theta}\rho_{\pi_{\theta}}(s,a))\log\pi_{\theta}(a|s)-\sum_{s}\rho_{\pi_{\theta}}(s)\sum_{a}\pi_{\theta}(a|s)\nabla_{\theta}\log\pi_{\theta}(a|s) \\ \displaystyle=-\sum_{s,a}(\nabla_{\theta}\rho_{\pi_{\theta}}(s,a))\log\pi_{\theta}(a|s)-\sum_{s}\rho_{\pi_{\theta}}(s)\sum_{a}\nabla_{\theta}\pi_{\theta}(a|s)∇θ​Eπθ​​[−logπθ​(a∣s)]=−∇θ​s,a∑​ρπθ​​(s,a)logπθ​(a∣s)=−s,a∑​(∇θ​ρπθ​​(s,a))logπθ​(a∣s)−s∑​ρπθ​​(s)a∑​πθ​(a∣s)∇θ​logπθ​(a∣s)=−s,a∑​(∇θ​ρπθ​​(s,a))logπθ​(a∣s)−s∑​ρπθ​​(s)a∑​∇θ​πθ​(a∣s)

The second term vanishes, because ∑a∇θπθ(a∣s)=∇θ∑aπθ(a∣s)=∇θ1=0\sum_{a}\nabla_{\theta}\pi_{\theta}(a|s)=\nabla_{\theta}\sum_{a}\pi_{\theta}(a|s)=\nabla_{\theta}1=0∑a​∇θ​πθ​(a∣s)=∇θ​∑a​πθ​(a∣s)=∇θ​1=0. We are left with

第二项消失,因为 ∑a∇θπθ(a∣s)=∇θ∑aπθ(a∣s)=∇θ1=0\sum_{a}\nabla_{\theta}\pi_{\theta}(a|s)=\nabla_{\theta}\sum_{a}\pi_{\theta}(a|s)=\nabla_{\theta}1=0∑a​∇θ​πθ​(a∣s)=∇θ​∑a​πθ​(a∣s)=∇θ​1=0。剩下

∇θEπθ[−log⁡πθ(a∣s)]=∑s,a(∇θρπθ(s,a))(−log⁡πθ(a∣s)),\displaystyle\nabla_{\theta}\mathbb{E}_{\pi_{\theta}}[-\log\pi_{\theta}(a|s)] \\ \displaystyle=\sum_{s,a}(\nabla_{\theta}\rho_{\pi_{\theta}}(s,a))(-\log\pi_{\theta}(a|s)),∇θ​Eπθ​​[−logπθ​(a∣s)]=s,a∑​(∇θ​ρπθ​​(s,a))(−logπθ​(a∣s)),

which is the policy gradient for RL with the fixed cost function clog(s,a)≜−log⁡πθ(a∣s)c_{\mathrm{log}}(s,a)\triangleq-\log\pi_{\theta}(a|s)clog​(s,a)≜−logπθ​(a∣s). The resulting formula is given by the standard policy gradient formula for clogc_{\mathrm{log}}clog​. ∎

这正是固定代价 clog(s,a)≜−log⁡πθ(a∣s)c_{\mathrm{log}}(s,a)\triangleq-\log\pi_{\theta}(a|s)clog​(s,a)≜−logπθ​(a∣s) 下强化学习的策略梯度。所得公式即 clogc_{\mathrm{log}}clog​ 的标准策略梯度公式。∎

Appendix B Environments and detailed results

附录 B 环境与详细结果

The environments we used for our experiments are from the OpenAI Gym [5]. The names and version numbers of these environments are listed in Table 1, which also lists dimension or cardinality of their observation and action spaces (numbers marked “continuous” indicate dimension for a continuous space, and numbers marked “discrete” indicate cardinality for a finite space).

实验所用环境来自 OpenAI Gym [5]。名称与版本见表 1,同时列出观测与动作空间的维数或基数(标「continuous」的是连续空间维数,标「discrete」的是有限空间基数)。

Task Observation space Action space Random policy performance Expert performance Cartpole-v0 4 (continuous) 2 (discrete) 18.64±7.4518.64\pm 7.4518.64±7.45 200.00±0.00200.00\pm 0.00200.00±0.00 Acrobot-v0 4 (continuous) 3 (discrete) −200.00±0.00-200.00\pm 0.00−200.00±0.00 −75.25±10.94-75.25\pm 10.94−75.25±10.94 Mountain Car-v0 2 (continuous) 3 (discrete) −200.00±0.00-200.00\pm 0.00−200.00±0.00 −98.75±8.71-98.75\pm 8.71−98.75±8.71 Reacher-v1 11 (continuous) 2 (continuous) −43.21±4.32-43.21\pm 4.32−43.21±4.32 −4.09±1.70-4.09\pm 1.70−4.09±1.70 HalfCheetah-v1 17 (continuous) 6 (continuous) −282.43±79.53-282.43\pm 79.53−282.43±79.53 4463.46±105.834463.46\pm 105.834463.46±105.83 Hopper-v1 11 (continuous) 3 (continuous) 14.47±7.9614.47\pm 7.9614.47±7.96 3571.38±184.203571.38\pm 184.203571.38±184.20 Walker-v1 17 (continuous) 6 (continuous) 0.57±4.590.57\pm 4.590.57±4.59 6717.08±845.626717.08\pm 845.626717.08±845.62 Ant-v1 111 (continuous) 8 (continuous) −69.68±111.10-69.68\pm 111.10−69.68±111.10 4228.37±424.164228.37\pm 424.164228.37±424.16 Humanoid-v1 376 (continuous) 17 (continuous) 122.87±35.11122.87\pm 35.11122.87±35.11 9575.40±1750.809575.40\pm 1750.809575.40±1750.80

Task Observation space Action space Random policy performance Expert performance Cartpole-v0 4 (continuous) 2 (discrete) 18.64±7.4518.64\pm 7.4518.64±7.45 200.00±0.00200.00\pm 0.00200.00±0.00 Acrobot-v0 4 (continuous) 3 (discrete) −200.00±0.00-200.00\pm 0.00−200.00±0.00 −75.25±10.94-75.25\pm 10.94−75.25±10.94 Mountain Car-v0 2 (continuous) 3 (discrete) −200.00±0.00-200.00\pm 0.00−200.00±0.00 −98.75±8.71-98.75\pm 8.71−98.75±8.71 Reacher-v1 11 (continuous) 2 (continuous) −43.21±4.32-43.21\pm 4.32−43.21±4.32 −4.09±1.70-4.09\pm 1.70−4.09±1.70 HalfCheetah-v1 17 (continuous) 6 (continuous) −282.43±79.53-282.43\pm 79.53−282.43±79.53 4463.46±105.834463.46\pm 105.834463.46±105.83 Hopper-v1 11 (continuous) 3 (continuous) 14.47±7.9614.47\pm 7.9614.47±7.96 3571.38±184.203571.38\pm 184.203571.38±184.20 Walker-v1 17 (continuous) 6 (continuous) 0.57±4.590.57\pm 4.590.57±4.59 6717.08±845.626717.08\pm 845.626717.08±845.62 Ant-v1 111 (continuous) 8 (continuous) −69.68±111.10-69.68\pm 111.10−69.68±111.10 4228.37±424.164228.37\pm 424.164228.37±424.16 Humanoid-v1 376 (continuous) 17 (continuous) 122.87±35.11122.87\pm 35.11122.87±35.11 9575.40±1750.809575.40\pm 1750.809575.40±1750.80

Table 1: Environments

任务 观测空间 动作空间 随机策略性能 专家性能 Cartpole-v0 4(连续) 2(离散) 18.64±7.4518.64\pm 7.4518.64±7.45 200.00±0.00200.00\pm 0.00200.00±0.00 Acrobot-v0 4(连续) 3(离散) −200.00±0.00-200.00\pm 0.00−200.00±0.00 −75.25±10.94-75.25\pm 10.94−75.25±10.94 Mountain Car-v0 2(连续) 3(离散) −200.00±0.00-200.00\pm 0.00−200.00±0.00 −98.75±8.71-98.75\pm 8.71−98.75±8.71 Reacher-v1 11(连续) 2(连续) −43.21±4.32-43.21\pm 4.32−43.21±4.32 −4.09±1.70-4.09\pm 1.70−4.09±1.70 HalfCheetah-v1 17(连续) 6(连续) −282.43±79.53-282.43\pm 79.53−282.43±79.53 4463.46±105.834463.46\pm 105.834463.46±105.83 Hopper-v1 11(连续) 3(连续) 14.47±7.9614.47\pm 7.9614.47±7.96 3571.38±184.203571.38\pm 184.203571.38±184.20 Walker-v1 17(连续) 6(连续) 0.57±4.590.57\pm 4.590.57±4.59 6717.08±845.626717.08\pm 845.626717.08±845.62 Ant-v1 111(连续) 8(连续) −69.68±111.10-69.68\pm 111.10−69.68±111.10 4228.37±424.164228.37\pm 424.164228.37±424.16 Humanoid-v1 376(连续) 17(连续) 122.87±35.11122.87\pm 35.11122.87±35.11 9575.40±1750.809575.40\pm 1750.809575.40±1750.80

表 1:环境

The amount of environment interaction used for FEM, GTAL, and our algorithm is shown in Table 2. To reduce gradient variance for these three algorithms, we also fit value functions, with the same neural network architecture as the policies, and employed generalized advantage estimation [27] (with γ=.995\gamma=.995γ=.995 and λ=.97\lambda=.97λ=.97). The exact experimental results are listed in Table 3. Means and standard deviations are computed over 50 trajectories. For the cartpole, mountain car, acrobot, and reacher, these statistics are further computed over 7 policies learned from random initializations.

FEM、GTAL 与我们的算法所用的环境交互量见表 2。为降低这三种算法的梯度方差,我们还用与策略相同架构的网络拟合值函数,并采用广义优势估计 [27](γ=.995\gamma=.995γ=.995,λ=.97\lambda=.97λ=.97)。精确实验结果见表 3。均值与标准差在 50 条轨迹上计算;对 cartpole、mountain car、acrobot 与 reacher,这些统计量还在 7 个随机初始化学到的策略上进一步汇总。

Task Training iterations State-action pairs per iteration Cartpole 300 5000 Mountain Car 300 5000 Acrobot 300 5000 Reacher 200 50000 HalfCheetah 500 50000 Hopper 500 50000 Walker 500 50000 Ant 500 50000 Humanoid 1500 50000

Task Training iterations State-action pairs per iteration Cartpole 300 5000 Mountain Car 300 5000 Acrobot 300 5000 Reacher 200 50000 HalfCheetah 500 50000 Hopper 500 50000 Walker 500 50000 Ant 500 50000 Humanoid 1500 50000

Table 2: Parameters for FEM, GTAL, and Algorithm 1

任务 训练迭代次数 每次迭代状态–动作对数 Cartpole 300 5000 Mountain Car 300 5000 Acrobot 300 5000 Reacher 200 50000 HalfCheetah 500 50000 Hopper 500 50000 Walker 500 50000 Ant 500 50000 Humanoid 1500 50000

表 2:FEM、GTAL 与算法 1 的参数

Task Dataset size Behavioral cloning FEM GTAL Ours Cartpole 1 72.02±35.8272.02\pm 35.8272.02±35.82 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 4 169.18±59.81169.18\pm 59.81169.18±59.81 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 7 188.60±29.61188.60\pm 29.61188.60±29.61 200.00±0.00200.00\pm 0.00200.00±0.00 199.94±1.14199.94\pm 1.14199.94±1.14 200.00±0.00200.00\pm 0.00200.00±0.00 10 177.19±52.83177.19\pm 52.83177.19±52.83 199.75±3.50199.75\pm 3.50199.75±3.50 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 Acrobot 1 −130.60±55.08-130.60\pm 55.08−130.60±55.08 −133.14±60.80-133.14\pm 60.80−133.14±60.80 −81.35±22.40-81.35\pm 22.40−81.35±22.40 −77.26±18.03-77.26\pm 18.03−77.26±18.03 4 −93.20±32.58-93.20\pm 32.58−93.20±32.58 −94.21±47.20-94.21\pm 47.20−94.21±47.20 −94.80±46.08-94.80\pm 46.08−94.80±46.08 −83.12±23.31-83.12\pm 23.31−83.12±23.31 7 −96.92±34.51-96.92\pm 34.51−96.92±34.51 −95.08±46.67-95.08\pm 46.67−95.08±46.67 −95.75±46.57-95.75\pm 46.57−95.75±46.57 −82.56±20.95-82.56\pm 20.95−82.56±20.95 10 −95.09±33.33-95.09\pm 33.33−95.09±33.33 −77.22±18.51-77.22\pm 18.51−77.22±18.51 −94.32±46.51-94.32\pm 46.51−94.32±46.51 −78.91±15.76-78.91\pm 15.76−78.91±15.76 Mountain Car 1 −136.76±34.44-136.76\pm 34.44−136.76±34.44 −100.97±12.54-100.97\pm 12.54−100.97±12.54 −115.48±36.35-115.48\pm 36.35−115.48±36.35 −101.55±10.32-101.55\pm 10.32−101.55±10.32 4 −133.25±29.97-133.25\pm 29.97−133.25±29.97 −99.29±8.33-99.29\pm 8.33−99.29±8.33 −143.58±50.08-143.58\pm 50.08−143.58±50.08 −101.35±10.63-101.35\pm 10.63−101.35±10.63 7 −127.34±29.15-127.34\pm 29.15−127.34±29.15 −100.65±9.36-100.65\pm 9.36−100.65±9.36 −128.96±46.13-128.96\pm 46.13−128.96±46.13 −99.90±7.97-99.90\pm 7.97−99.90±7.97 10 −123.14±28.26-123.14\pm 28.26−123.14±28.26 −100.48±8.14-100.48\pm 8.14−100.48±8.14 −120.05±36.66-120.05\pm 36.66−120.05±36.66 −100.83±11.40-100.83\pm 11.40−100.83±11.40 HalfCheetah 4 −493.62±246.58-493.62\pm 246.58−493.62±246.58 734.01±84.59734.01\pm 84.59734.01±84.59 1008.14±280.421008.14\pm 280.421008.14±280.42 4515.70±549.494515.70\pm 549.494515.70±549.49 11 637.57±1708.10637.57\pm 1708.10637.57±1708.10 −375.22±291.13-375.22\pm 291.13−375.22±291.13 226.06±307.87226.06\pm 307.87226.06±307.87 4280.65±1119.934280.65\pm 1119.934280.65±1119.93 18 2705.01±2273.002705.01\pm 2273.002705.01±2273.00 343.58±159.66343.58\pm 159.66343.58±159.66 1084.26±317.021084.26\pm 317.021084.26±317.02 4749.43±149.044749.43\pm 149.044749.43±149.04 25 3718.58±1856.223718.58\pm 1856.223718.58±1856.22 502.29±375.78502.29\pm 375.78502.29±375.78 869.55±447.90869.55\pm 447.90869.55±447.90 4840.07±95.364840.07\pm 95.364840.07±95.36 Hopper 4 50.57±0.9550.57\pm 0.9550.57±0.95 3571.98±6.353571.98\pm 6.353571.98±6.35 3065.21±147.793065.21\pm 147.793065.21±147.79 3614.22±7.173614.22\pm 7.173614.22±7.17 11 1025.84±266.861025.84\pm 266.861025.84±266.86 3572.30±12.033572.30\pm 12.033572.30±12.03 3502.71±14.543502.71\pm 14.543502.71±14.54 3615.00±4.323615.00\pm 4.323615.00±4.32 18 1949.09±500.611949.09\pm 500.611949.09±500.61 3230.68±4.583230.68\pm 4.583230.68±4.58 3201.05±6.743201.05\pm 6.743201.05±6.74 3600.70±4.243600.70\pm 4.243600.70±4.24 25 3383.96±657.613383.96\pm 657.613383.96±657.61 3331.05±3.553331.05\pm 3.553331.05±3.55 3458.82±5.403458.82\pm 5.403458.82±5.40 3560.85±3.093560.85\pm 3.093560.85±3.09 Walker 4 32.18±1.2532.18\pm 1.2532.18±1.25 3648.17±327.413648.17\pm 327.413648.17±327.41 4945.90±65.974945.90\pm 65.974945.90±65.97 4877.98±2848.374877.98\pm 2848.374877.98±2848.37 11 5946.81±1733.735946.81\pm 1733.735946.81±1733.73 4723.44±117.184723.44\pm 117.184723.44±117.18 6139.29±91.486139.29\pm 91.486139.29±91.48 6850.27±39.196850.27\pm 39.196850.27±39.19 18 1263.82±1347.741263.82\pm 1347.741263.82±1347.74 4184.34±485.544184.34\pm 485.544184.34±485.54 5288.68±37.295288.68\pm 37.295288.68±37.29 6964.68±46.306964.68\pm 46.306964.68±46.30 25 1599.36±1456.591599.36\pm 1456.591599.36±1456.59 4368.15±267.174368.15\pm 267.174368.15±267.17 4687.80±186.224687.80\pm 186.224687.80±186.22 6832.01±254.646832.01\pm 254.646832.01±254.64 Ant 4 1611.75±359.541611.75\pm 359.541611.75±359.54 −2052.51±49.41-2052.51\pm 49.41−2052.51±49.41 −5743.81±723.48-5743.81\pm 723.48−5743.81±723.48 3186.80±903.573186.80\pm 903.573186.80±903.57 11 3065.59±635.193065.59\pm 635.193065.59±635.19 −4462.70±53.84-4462.70\pm 53.84−4462.70±53.84 −6252.19±409.42-6252.19\pm 409.42−6252.19±409.42 3306.67±988.393306.67\pm 988.393306.67±988.39 18 2597.22±1366.572597.22\pm 1366.572597.22±1366.57 −5148.62±37.80-5148.62\pm 37.80−5148.62±37.80 −3067.07±177.20-3067.07\pm 177.20−3067.07±177.20 3033.87±1460.963033.87\pm 1460.963033.87±1460.96 25 3235.73±1186.383235.73\pm 1186.383235.73±1186.38 −5122.12±703.19-5122.12\pm 703.19−5122.12±703.19 −3271.37±226.66-3271.37\pm 226.66−3271.37±226.66 4132.90±878.674132.90\pm 878.674132.90±878.67 Humanoid 80 1397.06±1057.841397.06\pm 1057.841397.06±1057.84 5093.12±583.115093.12\pm 583.115093.12±583.11 5096.43±24.965096.43\pm 24.965096.43±24.96 10200.73±1324.4710200.73\pm 1324.4710200.73±1324.47 160 3655.14±3714.283655.14\pm 3714.283655.14±3714.28 5120.52±17.075120.52\pm 17.075120.52±17.07 5412.47±19.535412.47\pm 19.535412.47±19.53 10119.80±1254.7310119.80\pm 1254.7310119.80±1254.73 240 5660.53±3600.705660.53\pm 3600.705660.53±3600.70 5192.34±24.595192.34\pm 24.595192.34±24.59 5145.94±21.135145.94\pm 21.135145.94±21.13 10361.94±61.2810361.94\pm 61.2810361.94±61.28 Task Dataset size Behavioral cloning Ours (λ=0\lambda=0λ=0) Ours (λ=10−3\lambda=10^{-3}λ=10−3) Ours (λ=10−2\lambda=10^{-2}λ=10−2) Reacher 4 −10.97±7.07-10.97\pm 7.07−10.97±7.07 −67.23±88.99-67.23\pm 88.99−67.23±88.99 −32.37±39.81-32.37\pm 39.81−32.37±39.81 −46.72±82.88-46.72\pm 82.88−46.72±82.88 11 −6.23±3.29-6.23\pm 3.29−6.23±3.29 −6.06±5.36-6.06\pm 5.36−6.06±5.36 −6.61±5.11-6.61\pm 5.11−6.61±5.11 −9.26±21.88-9.26\pm 21.88−9.26±21.88 18 −4.76±2.31-4.76\pm 2.31−4.76±2.31 −8.25±21.99-8.25\pm 21.99−8.25±21.99 −5.66±3.15-5.66\pm 3.15−5.66±3.15 −5.04±2.22-5.04\pm 2.22−5.04±2.22

Task Dataset size Behavioral cloning FEM GTAL Ours Cartpole 1 72.02±35.8272.02\pm 35.8272.02±35.82 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 4 169.18±59.81169.18\pm 59.81169.18±59.81 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 7 188.60±29.61188.60\pm 29.61188.60±29.61 200.00±0.00200.00\pm 0.00200.00±0.00 199.94±1.14199.94\pm 1.14199.94±1.14 200.00±0.00200.00\pm 0.00200.00±0.00 10 177.19±52.83177.19\pm 52.83177.19±52.83 199.75±3.50199.75\pm 3.50199.75±3.50 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 Acrobot 1 −130.60±55.08-130.60\pm 55.08−130.60±55.08 −133.14±60.80-133.14\pm 60.80−133.14±60.80 −81.35±22.40-81.35\pm 22.40−81.35±22.40 −77.26±18.03-77.26\pm 18.03−77.26±18.03 4 −93.20±32.58-93.20\pm 32.58−93.20±32.58 −94.21±47.20-94.21\pm 47.20−94.21±47.20 −94.80±46.08-94.80\pm 46.08−94.80±46.08 −83.12±23.31-83.12\pm 23.31−83.12±23.31 7 −96.92±34.51-96.92\pm 34.51−96.92±34.51 −95.08±46.67-95.08\pm 46.67−95.08±46.67 −95.75±46.57-95.75\pm 46.57−95.75±46.57 −82.56±20.95-82.56\pm 20.95−82.56±20.95 10 −95.09±33.33-95.09\pm 33.33−95.09±33.33 −77.22±18.51-77.22\pm 18.51−77.22±18.51 −94.32±46.51-94.32\pm 46.51−94.32±46.51 −78.91±15.76-78.91\pm 15.76−78.91±15.76 Mountain Car 1 −136.76±34.44-136.76\pm 34.44−136.76±34.44 −100.97±12.54-100.97\pm 12.54−100.97±12.54 −115.48±36.35-115.48\pm 36.35−115.48±36.35 −101.55±10.32-101.55\pm 10.32−101.55±10.32 4 −133.25±29.97-133.25\pm 29.97−133.25±29.97 −99.29±8.33-99.29\pm 8.33−99.29±8.33 −143.58±50.08-143.58\pm 50.08−143.58±50.08 −101.35±10.63-101.35\pm 10.63−101.35±10.63 7 −127.34±29.15-127.34\pm 29.15−127.34±29.15 −100.65±9.36-100.65\pm 9.36−100.65±9.36 −128.96±46.13-128.96\pm 46.13−128.96±46.13 −99.90±7.97-99.90\pm 7.97−99.90±7.97 10 −123.14±28.26-123.14\pm 28.26−123.14±28.26 −100.48±8.14-100.48\pm 8.14−100.48±8.14 −120.05±36.66-120.05\pm 36.66−120.05±36.66 −100.83±11.40-100.83\pm 11.40−100.83±11.40 HalfCheetah 4 −493.62±246.58-493.62\pm 246.58−493.62±246.58 734.01±84.59734.01\pm 84.59734.01±84.59 1008.14±280.421008.14\pm 280.421008.14±280.42 4515.70±549.494515.70\pm 549.494515.70±549.49 11 637.57±1708.10637.57\pm 1708.10637.57±1708.10 −375.22±291.13-375.22\pm 291.13−375.22±291.13 226.06±307.87226.06\pm 307.87226.06±307.87 4280.65±1119.934280.65\pm 1119.934280.65±1119.93 18 2705.01±2273.002705.01\pm 2273.002705.01±2273.00 343.58±159.66343.58\pm 159.66343.58±159.66 1084.26±317.021084.26\pm 317.021084.26±317.02 4749.43±149.044749.43\pm 149.044749.43±149.04 25 3718.58±1856.223718.58\pm 1856.223718.58±1856.22 502.29±375.78502.29\pm 375.78502.29±375.78 869.55±447.90869.55\pm 447.90869.55±447.90 4840.07±95.364840.07\pm 95.364840.07±95.36 Hopper 4 50.57±0.9550.57\pm 0.9550.57±0.95 3571.98±6.353571.98\pm 6.353571.98±6.35 3065.21±147.793065.21\pm 147.793065.21±147.79 3614.22±7.173614.22\pm 7.173614.22±7.17 11 1025.84±266.861025.84\pm 266.861025.84±266.86 3572.30±12.033572.30\pm 12.033572.30±12.03 3502.71±14.543502.71\pm 14.543502.71±14.54 3615.00±4.323615.00\pm 4.323615.00±4.32 18 1949.09±500.611949.09\pm 500.611949.09±500.61 3230.68±4.583230.68\pm 4.583230.68±4.58 3201.05±6.743201.05\pm 6.743201.05±6.74 3600.70±4.243600.70\pm 4.243600.70±4.24 25 3383.96±657.613383.96\pm 657.613383.96±657.61 3331.05±3.553331.05\pm 3.553331.05±3.55 3458.82±5.403458.82\pm 5.403458.82±5.40 3560.85±3.093560.85\pm 3.093560.85±3.09 Walker 4 32.18±1.2532.18\pm 1.2532.18±1.25 3648.17±327.413648.17\pm 327.413648.17±327.41 4945.90±65.974945.90\pm 65.974945.90±65.97 4877.98±2848.374877.98\pm 2848.374877.98±2848.37 11 5946.81±1733.735946.81\pm 1733.735946.81±1733.73 4723.44±117.184723.44\pm 117.184723.44±117.18 6139.29±91.486139.29\pm 91.486139.29±91.48 6850.27±39.196850.27\pm 39.196850.27±39.19 18 1263.82±1347.741263.82\pm 1347.741263.82±1347.74 4184.34±485.544184.34\pm 485.544184.34±485.54 5288.68±37.295288.68\pm 37.295288.68±37.29 6964.68±46.306964.68\pm 46.306964.68±46.30 25 1599.36±1456.591599.36\pm 1456.591599.36±1456.59 4368.15±267.174368.15\pm 267.174368.15±267.17 4687.80±186.224687.80\pm 186.224687.80±186.22 6832.01±254.646832.01\pm 254.646832.01±254.64 Ant 4 1611.75±359.541611.75\pm 359.541611.75±359.54 −2052.51±49.41-2052.51\pm 49.41−2052.51±49.41 −5743.81±723.48-5743.81\pm 723.48−5743.81±723.48 3186.80±903.573186.80\pm 903.573186.80±903.57 11 3065.59±635.193065.59\pm 635.193065.59±635.19 −4462.70±53.84-4462.70\pm 53.84−4462.70±53.84 −6252.19±409.42-6252.19\pm 409.42−6252.19±409.42 3306.67±988.393306.67\pm 988.393306.67±988.39 18 2597.22±1366.572597.22\pm 1366.572597.22±1366.57 −5148.62±37.80-5148.62\pm 37.80−5148.62±37.80 −3067.07±177.20-3067.07\pm 177.20−3067.07±177.20 3033.87±1460.963033.87\pm 1460.963033.87±1460.96 25 3235.73±1186.383235.73\pm 1186.383235.73±1186.38 −5122.12±703.19-5122.12\pm 703.19−5122.12±703.19 −3271.37±226.66-3271.37\pm 226.66−3271.37±226.66 4132.90±878.674132.90\pm 878.674132.90±878.67 Humanoid 80 1397.06±1057.841397.06\pm 1057.841397.06±1057.84 5093.12±583.115093.12\pm 583.115093.12±583.11 5096.43±24.965096.43\pm 24.965096.43±24.96 10200.73±1324.4710200.73\pm 1324.4710200.73±1324.47 160 3655.14±3714.283655.14\pm 3714.283655.14±3714.28 5120.52±17.075120.52\pm 17.075120.52±17.07 5412.47±19.535412.47\pm 19.535412.47±19.53 10119.80±1254.7310119.80\pm 1254.7310119.80±1254.73 240 5660.53±3600.705660.53\pm 3600.705660.53±3600.70 5192.34±24.595192.34\pm 24.595192.34±24.59 5145.94±21.135145.94\pm 21.135145.94±21.13 10361.94±61.2810361.94\pm 61.2810361.94±61.28 Task Dataset size Behavioral cloning Ours (λ=0\lambda=0λ=0) Ours (λ=10−3\lambda=10^{-3}λ=10−3) Ours (λ=10−2\lambda=10^{-2}λ=10−2) Reacher 4 −10.97±7.07-10.97\pm 7.07−10.97±7.07 −67.23±88.99-67.23\pm 88.99−67.23±88.99 −32.37±39.81-32.37\pm 39.81−32.37±39.81 −46.72±82.88-46.72\pm 82.88−46.72±82.88 11 −6.23±3.29-6.23\pm 3.29−6.23±3.29 −6.06±5.36-6.06\pm 5.36−6.06±5.36 −6.61±5.11-6.61\pm 5.11−6.61±5.11 −9.26±21.88-9.26\pm 21.88−9.26±21.88 18 −4.76±2.31-4.76\pm 2.31−4.76±2.31 −8.25±21.99-8.25\pm 21.99−8.25±21.99 −5.66±3.15-5.66\pm 3.15−5.66±3.15 −5.04±2.22-5.04\pm 2.22−5.04±2.22

Table 3: Learned policy performance

任务 数据集大小 行为克隆 FEM GTAL 本文 Cartpole 1 72.02±35.8272.02\pm 35.8272.02±35.82 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 4 169.18±59.81169.18\pm 59.81169.18±59.81 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 7 188.60±29.61188.60\pm 29.61188.60±29.61 200.00±0.00200.00\pm 0.00200.00±0.00 199.94±1.14199.94\pm 1.14199.94±1.14 200.00±0.00200.00\pm 0.00200.00±0.00 10 177.19±52.83177.19\pm 52.83177.19±52.83 199.75±3.50199.75\pm 3.50199.75±3.50 200.00±0.00200.00\pm 0.00200.00±0.00 200.00±0.00200.00\pm 0.00200.00±0.00 Acrobot 1 −130.60±55.08-130.60\pm 55.08−130.60±55.08 −133.14±60.80-133.14\pm 60.80−133.14±60.80 −81.35±22.40-81.35\pm 22.40−81.35±22.40 −77.26±18.03-77.26\pm 18.03−77.26±18.03 4 −93.20±32.58-93.20\pm 32.58−93.20±32.58 −94.21±47.20-94.21\pm 47.20−94.21±47.20 −94.80±46.08-94.80\pm 46.08−94.80±46.08 −83.12±23.31-83.12\pm 23.31−83.12±23.31 7 −96.92±34.51-96.92\pm 34.51−96.92±34.51 −95.08±46.67-95.08\pm 46.67−95.08±46.67 −95.75±46.57-95.75\pm 46.57−95.75±46.57 −82.56±20.95-82.56\pm 20.95−82.56±20.95 10 −95.09±33.33-95.09\pm 33.33−95.09±33.33 −77.22±18.51-77.22\pm 18.51−77.22±18.51 −94.32±46.51-94.32\pm 46.51−94.32±46.51 −78.91±15.76-78.91\pm 15.76−78.91±15.76 Mountain Car 1 −136.76±34.44-136.76\pm 34.44−136.76±34.44 −100.97±12.54-100.97\pm 12.54−100.97±12.54 −115.48±36.35-115.48\pm 36.35−115.48±36.35 −101.55±10.32-101.55\pm 10.32−101.55±10.32 4 −133.25±29.97-133.25\pm 29.97−133.25±29.97 −99.29±8.33-99.29\pm 8.33−99.29±8.33 −143.58±50.08-143.58\pm 50.08−143.58±50.08 −101.35±10.63-101.35\pm 10.63−101.35±10.63 7 −127.34±29.15-127.34\pm 29.15−127.34±29.15 −100.65±9.36-100.65\pm 9.36−100.65±9.36 −128.96±46.13-128.96\pm 46.13−128.96±46.13 −99.90±7.97-99.90\pm 7.97−99.90±7.97 10 −123.14±28.26-123.14\pm 28.26−123.14±28.26 −100.48±8.14-100.48\pm 8.14−100.48±8.14 −120.05±36.66-120.05\pm 36.66−120.05±36.66 −100.83±11.40-100.83\pm 11.40−100.83±11.40 HalfCheetah 4 −493.62±246.58-493.62\pm 246.58−493.62±246.58 734.01±84.59734.01\pm 84.59734.01±84.59 1008.14±280.421008.14\pm 280.421008.14±280.42 4515.70±549.494515.70\pm 549.494515.70±549.49 11 637.57±1708.10637.57\pm 1708.10637.57±1708.10 −375.22±291.13-375.22\pm 291.13−375.22±291.13 226.06±307.87226.06\pm 307.87226.06±307.87 4280.65±1119.934280.65\pm 1119.934280.65±1119.93 18 2705.01±2273.002705.01\pm 2273.002705.01±2273.00 343.58±159.66343.58\pm 159.66343.58±159.66 1084.26±317.021084.26\pm 317.021084.26±317.02 4749.43±149.044749.43\pm 149.044749.43±149.04 25 3718.58±1856.223718.58\pm 1856.223718.58±1856.22 502.29±375.78502.29\pm 375.78502.29±375.78 869.55±447.90869.55\pm 447.90869.55±447.90 4840.07±95.364840.07\pm 95.364840.07±95.36 Hopper 4 50.57±0.9550.57\pm 0.9550.57±0.95 3571.98±6.353571.98\pm 6.353571.98±6.35 3065.21±147.793065.21\pm 147.793065.21±147.79 3614.22±7.173614.22\pm 7.173614.22±7.17 11 1025.84±266.861025.84\pm 266.861025.84±266.86 3572.30±12.033572.30\pm 12.033572.30±12.03 3502.71±14.543502.71\pm 14.543502.71±14.54 3615.00±4.323615.00\pm 4.323615.00±4.32 18 1949.09±500.611949.09\pm 500.611949.09±500.61 3230.68±4.583230.68\pm 4.583230.68±4.58 3201.05±6.743201.05\pm 6.743201.05±6.74 3600.70±4.243600.70\pm 4.243600.70±4.24 25 3383.96±657.613383.96\pm 657.613383.96±657.61 3331.05±3.553331.05\pm 3.553331.05±3.55 3458.82±5.403458.82\pm 5.403458.82±5.40 3560.85±3.093560.85\pm 3.093560.85±3.09 Walker 4 32.18±1.2532.18\pm 1.2532.18±1.25 3648.17±327.413648.17\pm 327.413648.17±327.41 4945.90±65.974945.90\pm 65.974945.90±65.97 4877.98±2848.374877.98\pm 2848.374877.98±2848.37 11 5946.81±1733.735946.81\pm 1733.735946.81±1733.73 4723.44±117.184723.44\pm 117.184723.44±117.18 6139.29±91.486139.29\pm 91.486139.29±91.48 6850.27±39.196850.27\pm 39.196850.27±39.19 18 1263.82±1347.741263.82\pm 1347.741263.82±1347.74 4184.34±485.544184.34\pm 485.544184.34±485.54 5288.68±37.295288.68\pm 37.295288.68±37.29 6964.68±46.306964.68\pm 46.306964.68±46.30 25 1599.36±1456.591599.36\pm 1456.591599.36±1456.59 4368.15±267.174368.15\pm 267.174368.15±267.17 4687.80±186.224687.80\pm 186.224687.80±186.22 6832.01±254.646832.01\pm 254.646832.01±254.64 Ant 4 1611.75±359.541611.75\pm 359.541611.75±359.54 −2052.51±49.41-2052.51\pm 49.41−2052.51±49.41 −5743.81±723.48-5743.81\pm 723.48−5743.81±723.48 3186.80±903.573186.80\pm 903.573186.80±903.57 11 3065.59±635.193065.59\pm 635.193065.59±635.19 −4462.70±53.84-4462.70\pm 53.84−4462.70±53.84 −6252.19±409.42-6252.19\pm 409.42−6252.19±409.42 3306.67±988.393306.67\pm 988.393306.67±988.39 18 2597.22±1366.572597.22\pm 1366.572597.22±1366.57 −5148.62±37.80-5148.62\pm 37.80−5148.62±37.80 −3067.07±177.20-3067.07\pm 177.20−3067.07±177.20 3033.87±1460.963033.87\pm 1460.963033.87±1460.96 25 3235.73±1186.383235.73\pm 1186.383235.73±1186.38 −5122.12±703.19-5122.12\pm 703.19−5122.12±703.19 −3271.37±226.66-3271.37\pm 226.66−3271.37±226.66 4132.90±878.674132.90\pm 878.674132.90±878.67 Humanoid 80 1397.06±1057.841397.06\pm 1057.841397.06±1057.84 5093.12±583.115093.12\pm 583.115093.12±583.11 5096.43±24.965096.43\pm 24.965096.43±24.96 10200.73±1324.4710200.73\pm 1324.4710200.73±1324.47 160 3655.14±3714.283655.14\pm 3714.283655.14±3714.28 5120.52±17.075120.52\pm 17.075120.52±17.07 5412.47±19.535412.47\pm 19.535412.47±19.53 10119.80±1254.7310119.80\pm 1254.7310119.80±1254.73 240 5660.53±3600.705660.53\pm 3600.705660.53±3600.70 5192.34±24.595192.34\pm 24.595192.34±24.59 5145.94±21.135145.94\pm 21.135145.94±21.13 10361.94±61.2810361.94\pm 61.2810361.94±61.28 任务 数据集大小 行为克隆 本文(λ=0\lambda=0λ=0) 本文(λ=10−3\lambda=10^{-3}λ=10−3) 本文(λ=10−2\lambda=10^{-2}λ=10−2) Reacher 4 −10.97±7.07-10.97\pm 7.07−10.97±7.07 −67.23±88.99-67.23\pm 88.99−67.23±88.99 −32.37±39.81-32.37\pm 39.81−32.37±39.81 −46.72±82.88-46.72\pm 82.88−46.72±82.88 11 −6.23±3.29-6.23\pm 3.29−6.23±3.29 −6.06±5.36-6.06\pm 5.36−6.06±5.36 −6.61±5.11-6.61\pm 5.11−6.61±5.11 −9.26±21.88-9.26\pm 21.88−9.26±21.88 18 −4.76±2.31-4.76\pm 2.31−4.76±2.31 −8.25±21.99-8.25\pm 21.99−8.25±21.99 −5.66±3.15-5.66\pm 3.15−5.66±3.15 −5.04±2.22-5.04\pm 2.22−5.04±2.22

表 3:学到策略的性能