Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

基于pytorch的强化学习2d机械臂小实验(DDPG算法)

Notifications You must be signed in to change notification settings

gezp/pytorch_RL_2d_robot_arm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pytorch RL 2d robot arm

基于pytorch的2d机械臂强化学习项目。最近学习莫烦大神的强化学习课程: RL-build-arm-from-scratch1.但是原版提供强化学习代码的基于tensorflow的代码,由于本人相对喜欢pytorch编程,这里提供基于pytorch方案。原课程有5节课。

  • Part 1: built a training framework
  • Part 2: Learn to build a environment from scratch
  • Part 3: Complete the basic environment script, see how arm moves
  • Part 4: Plug a Reinforcement Learning method and try to train it
  • Part 5: Optimize and debug it
  • Final: Make a moving goal

该部分代码对应final部分,只更改了rl.py部分,替换tensorflow为pytorch。

只有part 4,part5,final涉及强化学习,只需要替换rl.py文件即可,api完全兼容。需要新建model目录用来保存模型。

该版本强化学习算法采用的是 DDPG 。也是从网上找到的代码,修改了部分api,形成rl.py文件。

参考链接:Deep-reinforcement-learning-with-pytorch

Requirements

  • python=3.6

  • pytorch=1.0

  • gym=0.12(无需MuJoCo )


快速开始

该项目包含训练好的模型(GPU下训练),在model目录下,所以可以直接开始测试

测试:

修改main.py代码

ON_TRAIN = False

运行

python main.py

训练:

修改main.py代码

ON_TRAIN = True

运行

python main.py

如有侵权,联系删除。

About

基于pytorch的强化学习2d机械臂小实验(DDPG算法)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages