offline 2 online | AWAC:基于 AWR 的 policy update + online 补充数据集
- 论文题目:AWAC: Accelerating Online Reinforcement Learning with Offline Datasets
- ICLR 2021 reject,3 4 6 6 6,但是是师兄推荐的 offline 2 online 文章。
- pdf 版本:https://arxiv.org/pdf/2006.09359.pdf
- html 版本:https://ar5iv.labs.arxiv.org/html/2006.09359
- open review:https://openreview.net/forum?id=OJiM1R3jAtZ
- 项目网站:https://awacrl.github.io/
- 找到一个神秘实现:https://github.com/nsattiraju/RL-Simple-implementation-of-AWAC-algorithm
0 abstract
Reinforcement learning (RL) provides an appealing formalism for learning control policies from experience. However, the classic active formulation of RL necessitates a lengthy active exploration process for each behavior, making it difficult to apply in real-world settings such as robotic control. If we can instead allow RL algorithms to effectively use previously collected data to aid the online learning process, such applications could be made substantially more practical: the prior data would provide a starting point that mitigates challenges due to exploration and sample complexity, while the online training enables the agent to perfect the desired skill. Such prior data could either constitute expert demonstrations or, more generally, sub-optimal prior data that illustrates potentially useful transitions. While a number of prior methods have either used optimal demonstrations to bootstrap reinforcement learning, or have used sub-optimal data to train purely offline, it remains exceptionally difficult to train a policy with potentially sub-optimal offline data and actually continue to improve it further with online RL. In this paper we systematically analyze why this problem is so challenging, and propose an algorithm that combines sample-efficient dynamic programming with maximum likelihood policy updates, providing a simple and effective framework that is able to leverage large amounts of offline data and then quickly perform online fine-tuning of RL policies. We show that our method, advantage weighted actor critic (AWAC), enables rapid learning of skills with a combination of prior demonstration data and online experience. We demonstrate these benefits on a variety of simulated and real-world robotics domains, including dexterous manipulation with a real multi-fingered hand, drawer opening with a robotic arm, and rotating a valve. Our results show that incorporating prior data can reduce the time required to learn a range of robotic skills to practical time-scales.
- 背景:
- offline 2 online:如果利用 offline dataset 来帮助 online RL,那么 offline dataset 可以提供一个 RL training 的起点,减轻从头开始 exploration 和 sample complexity 的挑战,而 online training 可以令 agent 更完全掌握技能。
- offline dataset:什么都可以。可能是专家演示,或者更一般的,是包含 potentially useful transitions 的 sub-optimal data。
- 先前工作:要么使用 optimal demos(最优演示)来引导 RL,要么使用 sub-optimal data 进行纯粹的 offline RL。使用 sub-optimal 的 offline data 训练一个策略,并继续跑 online RL 进一步改善策略,貌似是一个 gap。
- method:
- 在本文中,我们系统分析了 offline 2 online 的挑战性。
- 提出了一种结合 sample-efficient dynamic programming(policy iteration 的策略评估)与 maximum likelihood policy updates(策略更新)的算法,提供了一个简单有效的框架,能先利用大量的 offline data,然后对 RL policy 进行快速 online fine-tune。
- 我们的方法,即优势加权演员评论家 (advantage weighted actor-critic,AWAC),能够结合 offline data + online data。
- 实验:
- 各种 simulation 和 real world 的 robot manipulation,真机的多指灵巧手、用机械臂打开抽屉、旋转阀门。
- 结果表明,结合 offline dataset,可以将学习一系列机器人技能所需的时间,减少到可行的时间尺度。
方法总结
- 采用 policy iteration 的框架。
- policy evaluation:从数据集 β 里采样 (s,a,r,s'),更新 \(BQ(s,a)=r(s,a)+\gamma E_{a'}Q(s',a')\) 。这里的 a 可能是 unseen data。
- policy improvement:从数据集 β 里采样 (s,a),最大化 \(\pi_\beta(a|s)\exp\big(\frac{1}{\lambda}A^{\pi_k}(s,a)\big)\) 。
- 数据集 β 的维护:最初用 offline dataset 初始化,然后逐渐添加 online 的数据(直接用 \(\pi_\theta\) 采样)。
open review
贡献:
- 使用 offline dataset 加速 online RL:提出了 Advantage-Weighted Actor-Critic(优势加权 actor-critic,AWAC)算法,使用隐式约束来减少 offline 训练时累积的 bootstrapping error,并减少 online fine-tune 时的 conservation(保守)。
- proposed method 与 AWR 非常相似,但没有使用 Monte-Carlo 方法估计 behavior policy 的 value function,而是通过 bootstrapping 来估计当前策略的 Q 函数。
- 实验:从人类演示和 off-policy data 中学习到困难 高维 奖励稀疏的 灵巧操纵问题,正文中是 MuJoCo 模拟器的三个问题。
缺点:
- novelty: incremental,貌似就是 AWR + fine-tune?(好像魔改了一点 AWR,但真的跟 AWR 很像)
- 实验:实验并不能证明这种方法是合理的,AWAC 仅在 relocate-binary-v0 中优于其他方法,而在 Walker2d-v2 中一点都不好。ABM 几乎能获得相同的性能。()
- 实验:貌似没有使用 D4RL?(后来又补实验了)
- 写作:related work 仅罗列,没有讨论。
- 贡献:online fine-tune 真的存在 bootstrapping error accumulation 的问题嘛?所以,提出的方法对 online training 真的有贡献嘛?
3 offline RL + online fine-tune 的挑战
- section 3.2:在 data efficiency 方面,对于 online fine-tune,发现 on-policy fine-tune 和 Monte-Carlo return 的效率,比 off-policy 的 actor-critic 低。
- section 3.3:对普通 actor-critic 算法,offline 2 online 会发生可怕的事情。
- 在 replay buffer 里面放了一些 offline dataset,但 SACfD-prior 的性能跟 SAC-scratch(从头开始训,不能访问 offline data)类似,这表明 off-policy RL 其实不能直接利用 off-policy data(?)(原文说的好迷惑,感觉有点没道理)
- (见图 3.2)SACfD-pretrain 是通过 behavior cloning 预训练的,结果一旦 online 训练,性能便迅速下降到没有训过的模样了()
- 仍然主要因为,Q function 中 off-policy bootstrapping error 的 accumulation,即,对于在 offline data 里 unobserved 的 action 更新 Q function。
- 为解决这种 extrapolation error,offline RL 会约束 policy update,使得 D(\(\pi\), \(\pi_\beta\)) ≤ ε,其中 \(\pi_\beta\) 是 offline behavior policy 的混合分布(比如使用一些 advantage weighted 混合)。
- section 3.4:过于保守的 online learning。虽然 constraint offline RL 性能很好,但很难 online fine-tune(图 3.3)。
- 当 offline 学到的 behavior model 不准确,或无法对新数据进行很好地建模时,受约束的优化(因为希望 online policy 的 action distribution 跟 offline policy 相近)会变得过于保守,导致 fine-tune 的改进有限。
- 因此,我们需要一种 1. 防止 offline 不稳定、2. 防止 offline 的 bootstrap error 累积、3. online 不会过于保守 的 off-policy 算法,用于提供 offline 的训练起点。
4 method: AWAC
- AWAC 貌似使用了 policy iteration 框架(policy update + policy evaluation)。
- policy update:
- 用 TD bootstrapping 去对 critic 的 value function 做 maximize update。但是,如果这样 naive 地做,可能会导致 3.4 节描述的 online fine-tune 性能无提升问题。
- 我们通过限制 policy distribution 接近 actor 在 online update 期间迄今为止观察到的数据,来避免 bootstrapping error 的 accumulation,同时令新策略最大化 advantage。
- policy update 的策略约束:
- 根据 3.3 节,如果使用显式的 behavior model(?)来强制执行约束,fine-tune 性能会不好。因此,我们进行隐式约束。
- 公式 8: \(\pi_{k+1}=\arg\max_a E[A^{\pi_k}(s,a)]\) ,最大化 advantage。
- 公式 9: \(s.t. D_{KL}(\pi|\pi_\beta)\le \epsilon\) ,policy update 的约束。
- 首先,写出公式 8 9 的拉格朗日, \(L(\pi,\lambda)=E_{a\sim\pi}[A(s,a)]+\lambda(\epsilon-D_{KL}(\pi(s)|\pi_\beta(s)))\) 。好像使用一些 KKT,能得到神奇闭式解, \(\pi^*(a|s)\propto \pi_\beta(a|s)\exp\big(\frac{1}{\lambda}A^{\pi_k}(s,a)\big)\) 。(看起来好像 AWR)
- 公式 13:貌似是通过 argmax,直接更新 policy 的参数 θ。公式 13 声称,只需在 offline data + online 采到的 data 里采样即可,无需建模 behavior policy \(\pi_\beta\) 。
- policy evaluation:
- 公式 2 3:普通的 bellman update 计算 Q function。
- \(BQ = r(s,a) + \gamma Q(s',a')\) 里的 s,a,s' 都是从 β 里采样的。
- 算法细节可以看 Appendix A.2。
- 声称的 novelty:
- 与 AWR [41] 相比,AWAC 使用 TD bootstrap,限制提高效率,甚至渐近提高性能。(没太看懂)
- 与ABM [49]、MPO [2]、BEAR [30]、BCQ [14] 等 offline RL 相比,AWAC 不做 behavior policy 的 modelling(?)

6 experiment
出现了很像 Pieter Abbeel 组的 we aim to answer the following question。(这篇文章是 Sergey Levine 组的)
真机照片,有几张感觉拍的不够有质感()
MuJoCo 模拟器 [53] 中使用 28-DoF 五指手的复杂操作技能,用 25 个 human demo 训了一个 behavior cloning 的策略,然后用这个策略生成了 500 条轨迹。
实验结果没有仔细看。
offline 2 online | AWAC:基于 AWR 的 policy update + online 补充数据集的更多相关文章
- ASP.NET Core MVC 2.x 全面教程_ASP.NET Core MVC 17. 基于Claim和Policy的授权 上
首先补一下昨天没有讲的东西 只有管理员才能访问UserController RoleController都加上这个角色 Cliam 不是管理员角色的用户访问 cliam是name个Value值的键值对 ...
- ASP.NET Core MVC 2.x 全面教程_ASP.NET Core MVC 18. 基于Claim和Policy的授权 下 - 自定义Policy
在加一个策略,要求cliam的值必须是123 第二个参数的类型 可变参数 ,可以是这三种类型 变成一个集合也可以 策略内置的几种方式 自定义 RequireAssetion的参数是个Func,Func ...
- 基于tensorflow的文本分类总结(数据集是复旦中文语料)
代码已上传到github:https://github.com/taishan1994/tensorflow-text-classification 往期精彩: 利用TfidfVectorizer进行 ...
- Manually enable Appear Offline in Lync 2013 Preview via Registry
refer to http://www.shudnow.net/2012/09/18/manually-enable-appear-offline-in-lync-2013-preview-via-r ...
- 基于 Java 2 运行时安全模型的线程协作--转
在 Java 2 之前的版本,运行时的安全模型使用非常严格受限的沙箱模型(Sandbox).读者应该熟悉,Java 不受信的 Applet 代码就是基于这个严格受限的沙箱模型来提供运行时的安全检查.沙 ...
- Oracle性能调整ASH,AWR,ADDM
ASH (Active Session History)ASH以V$SESSION为基础,每秒采样一次,记录活动会话等待的事件.不活动的会话不会采样,采样工作由新引入的后台进程MMNL来完成.ASH ...
- 基于.NET6的简单三层管理系统
前言 笔者前段时间搬砖的时候,有了一个偷懒的想法:如果开发的时候,简单的CURD可以由代码生成器完成,相应的实体.服务都不需要再做额外的注册,这样开发人员可以省了很多事. 于是就开了这个项目,期望实现 ...
- 基于C#的机器学习--c# .NET中直观的深度学习
在本章中,将会学到: l 如何使用Kelp.Net来执行自己的测试 l 如何编写测试 l 如何对函数进行基准测试 Kelp.Net是一个用c#编写的深度学习库.由于能够将函数链到函数堆栈中,它在 ...
- Policy Gradient Algorithms
Policy Gradient Algorithms 2019-10-02 17:37:47 This blog is from: https://lilianweng.github.io/lil-l ...
- 基于正向扫描的并行区间连接平面扫描算法(IEEE论文)
作者: Panagiotis Bouros ∗Department of Computer ScienceAarhus University, Denmarkpbour@cs.au.dkNikos M ...
随机推荐
- Serverless 架构下的 AI 应用开发
Serverless架构与CI/CD工具的结合 CI/CD 是一种通过在应用开发阶段引入自动化流程以频繁向客户交付应用的方法.如图所示,CI/CD 的核心概念是持续集成.持续交付和持续部署. 作为一个 ...
- 解决刷新页面丢失vuex数据
- nextTick使用
- P1725-DP【绿】
这道题最开始我用记搜写的,然后WA了一些点,后来看了半天才发现是数组开小了,原来他给了两个数据范围,一个是60%数据的数据范围,另一个是100%数据的数据范围.我没仔细看,没看见后面那行,把60%数据 ...
- poj 1426 深搜
***可能有多个答案,DFS一下找出一个答案即可*** #include<stdio.h> #include<string.h> #include<stdlib.h> ...
- 以太网链路连接 和 ISIS/OSPF等路由协议关系
转载请注明出处: 以太网链路连接和ISIS/OSPF协议之间存在关联和区别 关联: 以太网链路连接是指通过以太网物理媒介(如电缆)将网络设备进行连接,使它们可以交换数据. ISIS(Intermedi ...
- MySQL 查询索引失效及如何进行索引优化
本文为博主原创,未经允许不得转载: 我们都知道创建索引的目的是快速从整体集合中选择性地读取满足条件的一部分集合.mysql中一张表是可以支持多个索引的.但是,你写sql语句的时候,并没有主动指定使用哪 ...
- Linux 常见重要系统文件
Linux 常见重要系统文件 目录 Linux 常见重要系统文件 网卡配置文件 文件内容举例: DNS配置文件 文件内容举例: 系统hosts文件 文件内容举例: fstab文件 文件内容举例: rc ...
- js - setInterval的停止与重新启动
使用js处理问题的时候,我们可能会经常使用到setInterval()来进行定时任务或者轮询的操作,那么如何让setInterval停止和重新启动呢,下边的代码就可以实现的呦,如果有更好的方法,不吝赐 ...
- 聊聊x86计算机启动发生的事?
大家好,我是呼噜噜,最近在看linux早期内核0.12的源码,突然想到一个困扰自己好久的问题:当我们按下电源键,计算机发生了什么?神秘地址0x7C00究竟是什么?操作系统又是如何被加载到硬件中的?带着 ...