2018-10-18 16:51:16 +08:00
2018-10-10 16:17:53 +08:00
2018-11-12 18:02:50 +08:00
2018-10-31 21:19:03 +08:00
2018-11-16 17:37:57 +08:00
2018-11-16 17:48:20 +08:00
2018-10-26 15:13:33 +08:00
2018-11-15 14:58:20 +08:00
2018-11-09 08:48:36 +08:00
2018-07-10 11:47:11 +08:00
2018-11-11 15:12:25 +08:00
2018-08-07 10:54:21 +08:00
2018-11-16 17:47:20 +08:00
2018-07-30 10:43:24 +08:00
2018-07-27 14:00:20 +08:00

This repository will implement the classic deep reinforcement learning algorithms. The aim of this repository is to provide clear code for people to learn the deep reinforcement learning algorithm.

In the future, more algorithms will be added and the existing codes will also be maintained.

demo

Installation

  1. install the pytorch
plase go to official webisite to install it: https://pytorch.org/

Recommend use Anaconda Virtual Environment to manage your packages

  1. install openai-baselines (the openai-baselines update so quickly, please use the older version as blow, will solve in the future.)
# clone the openai baselines
git clone https://github.com/openai/baselines.git
cd baselines
git checkout 366f486
pip install -e .

DQN

Here I uploaded two DQN models, training Cartpole and mountaincar.

Tips for MountainCar-v0

This is very sparse for MountainCar-v0, it is 0 at the beginning, only when the top of the mountain is 1, there is a reward. This leads to the fact that if the sample to the top of the mountain is not taken during training, basically the train will not come out. So you can change the reward, for example, to change to the current position of the Car is positively related. Of course, there is a more advanced approach to inverse reinforcement learning (using GAN).

value_loss
step This is value loss for DQN, We can see that the loss increaded to 1e13 however, the network work well. This is because the training is going on, the target_net and act_net are very different, so the calculated loss becomes very large. The previous loss was small because the reward was very sparse, resulting in a small update of the two networks.

Policy Gradient

Use the following command to run a saved model

python Run_Model.py

Use the following command to train model

pytorch_MountainCar-v0.py

policyNet.pkl

This is a model that I have trained.

Actor-Critic

This is an algorithmic framework, and the classic REINFORCE method is stored under Actor-Critic.

PPO

Proximal-Policy-Optimization

A2C

Advantage Policy Gradient, an paper in 2017 pointed out that the difference in performance between A2C and A3C is not obvious.

A3C

A common reproduction

Alphago zero

I will reproduce AlphagoZero in wargame.

Timeline

  • 2018/11/01 gives the Resnet15Dense1 version, which has poor convergence, but the winning rate can reach 85%.

  • 2018/11/12 Gives the Resnet12Dense3 version, which is the first convergence and stable trend, with a winning percentage of 92%.

  • 2018/11/13 The Resnet12Dense3-v2 version is given. This version is very stable and the winning rate is gradually increasing. Performance to be observed

  • 2018/11/15 After 3 days of training, Wargame AI is given - the version of Gou Chen, the hit rate is stable at over 90%.

  • 2018/11/16 The rate of Chen Chen wins 96%.

  • 2018/11/01 给出Resnet15Dense1 版本,该版本收敛性不好,但胜率能够达到85%.只能够找点适用

  • 2018/11/12 给出Resnet12Dense3 版本,该版本第一次出现收敛、稳定趋势,胜率达到92%

  • 2018/11/13 给出Resnet12Dense3-v2版本, 该版本收敛性非常稳定,胜率逐步上升。性能待观测

  • 2018/11/15 经过3天的训练,给出Wargame AI —— 勾陈版本,勾陈胜率稳定在90%以上。

  • 2018/11/16 勾陈版本,勾陈胜率达到96%。

[1] A Brief Survey of Deep Reinforcement Learning
[2] The Beta Policy for Continuous Control Reinforcement Learning
[3] Playing Atari with Deep Reinforcement Learning
[4] Deep Reinforcement Learning with Double Q-learning
[5] Dueling Network Architectures for Deep Reinforcement Learning
[6] Continuous control with deep reinforcement learning
[7] Continuous Deep Q-Learning with Model-based Acceleration
[8] Asynchronous Methods for Deep Reinforcement Learning
[9] Trust Region Policy Optimization
[10] Proximal Policy Optimization Algorithms
[11] Scalable trust-region method for deep reinforcement learning using Kronecker-factored approximation

TO DO

  • DDPG
  • ACER
  • TRPO
  • DPPO
S
Description
PyTorch implementation of DQN, AC, ACER, A2C, A3C, PG, DDPG, TRPO, PPO, SAC, TD3 and ....
Readme MIT
43 MiB
Languages
Python 100%