作者丨李国豪
学校丨中国科学院大学&上海科技大学
研究方向丨无人驾驶,强化学习
指导老师丨林宝军教授
1. 前言
本文主要讲解 DeepMind 发布在 ICLR 2016 的文章 Continuous control with deep reinforcement learning,时间稍微有点久远,但因为算法经典,还是值得去实现。
2. 环境
这次实验环境是 Openai Gym 的 Pendulum-v0,state 是 3 维连续的表示杆的位置方向信息,action 是 1 维的连续动作,大小是 -2.0 到 2.0,表示对杆施加的力和方向。目标是让杆保持直立,所以 reward 在杆保持直立不动的时候最大。笔者所用的环境为:
Tensorflow (1.2.1)
gym (0.9.2)
请先安装 Tensorflow 和 gym,Tensorflow 和 gym 的安装就不赘述了,下面是网络收敛后的结果。
class="video_iframe" data-vidtype="2" allowfullscreen="" frameborder="0" data-ratio="1" data-w="272" data-src="http://v.qq.com/iframe/player.html?vid=y1325jlix3j&width=650&height=487.5&auto=0" style="display: block; width: 650px !important; height: 487.5px !important;" width="650" height="487.5" data-vh="487.5" data-vw="650" src="http://v.qq.com/iframe/player.html?vid=y1325jlix3j&width=650&height=487.5&auto=0"/>
3. 代码详解