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 ...
随机推荐
- 阿里云蝉联 FaaS 领导者,产品能力获最高分
日前,权威咨询机构 Forrester 发布 The Forrester Wave: Functions-As-A-Service Platforms, Q2 2023.阿里云凭借函数计算的产品能力在 ...
- springboot+dubbo+myBatis实现微服务集成
springboot+dubbo+myBatis实现微服务集成 代码下载:https://download.csdn.net/download/typ1805/10485048 微服务架构成了当下的技 ...
- B3637-DP【橙】
这题我用sort的时候大意了,从1开始使用的下标但是用sort时没加1导致排序错误,排了半天错才发现. 另外,这道题我似乎用了一种与网络上搜到了做法截然不同的自己的瞎想出来的做法,我的这个做法需要n^ ...
- UEditor 添加在线管理图片删除功能 (转载)
第一,需要添加一个 php 文件来实现删除功能,文件添加到: ueditor\php\action_delete.php 代码内容: <?php /*---------------------- ...
- .Net 使用 MongoDB
1.安装nuget包 MongoDB.Driver 2.简单代码 using MongoDB.Bson; using MongoDB.Driver; using System.Buffers; usi ...
- [转帖]解Bug之路-记一次JVM堆外内存泄露Bug的查找
https://zhuanlan.zhihu.com/p/245401095 解Bug之路-记一次JVM堆外内存泄露Bug的查找 前言 JVM的堆外内存泄露的定位一直是个比较棘手的问题.此次的Bug查 ...
- [转帖]mysql8.0 MySQL函数
PART1. MySQL函数介绍 函数表示对输入参数值返回一个具有特定关系的值,MySQL提供了大量丰富的函数,在进行数据库管理以及数据的查询和操作时将会经常用到各种函数.各类函数从功能方面主要分为数 ...
- [转帖] Linux命令拾遗-查看系统信息
https://www.cnblogs.com/codelogs/p/16060714.html 简介# 作为一名程序员,有时需要关注自己的进程运行在什么样的软硬件环境里,比如几核cpu.固态硬盘还是 ...
- [转帖]docker 最新版本升级
文章目录 前言 一.卸载低版本docker 1.1 检查docker版本 1.2 删除docker 二.开始安装 2.1 安装所需依赖 2.2 设置docker yum源 2.3 查看所有可用版本 2 ...
- [转帖]队列深度对IO性能的影响
https://www.modb.pro/db/43710 几年前一个客户的Oracle数据库经常HANG,老白帮他分析了一下,结论是存储老化,性能不足以支撑现有业务了.正好用户手头有个华为S5600 ...