README.md 2.0 KB
Newer Older
1 2 3
## Reproduce IMPALA with PARL
Based on PARL, the IMPALA algorithm of deep reinforcement learning is reproduced, and the same level of indicators of the paper is reproduced in the classic Atari game.

R
rical730 已提交
4
> Paper: IMPALA in [Impala: Scalable distributed deep-rl with importance weighted actor-learner architectures](https://arxiv.org/abs/1802.01561)
5 6

### Atari games introduction
H
Hongsheng Zeng 已提交
7
Please see [here](https://gym.openai.com/envs/#atari) to know more about Atari games.
8 9

### Benchmark result
H
Hongsheng Zeng 已提交
10
Result with one learner (in a P40 GPU) and 32 actors (in 32 CPUs).
11 12 13 14 15 16 17 18 19 20 21
+ PongNoFrameskip-v4: mean_episode_rewards can reach 18-19 score in about 7~10 minutes.
<img src=".benchmark/IMPALA_Pong.jpg" width = "400" height ="300" alt="IMPALA_Pong" />

+ Results of other games in an hour.

<img src=".benchmark/IMPALA_Breakout.jpg" width = "400" height ="300" alt="IMPALA_Breakout" /> <img src=".benchmark/IMPALA_BeamRider.jpg" width = "400" height ="300" alt="IMPALA_BeamRider"/>
<br>
<img src=".benchmark/IMPALA_Qbert.jpg" width = "400" height ="300" alt="IMPALA_Qbert" /> <img src=".benchmark/IMPALA_SpaceInvaders.jpg" width = "400" height ="300" alt="IMPALA_SpaceInvaders"/>

## How to use
### Dependencies
B
Bo Zhou 已提交
22
+ [paddlepaddle>=1.6.1](https://github.com/PaddlePaddle/Paddle)
23
+ [parl](https://github.com/PaddlePaddle/PARL)
H
Hongsheng Zeng 已提交
24 25
+ gym==0.12.1
+ atari-py==0.1.7
26 27 28

### Distributed Training:

F
fuyw 已提交
29
At first, We can start a local cluster with 32 CPUs:
30

F
fuyw 已提交
31 32
```bash
xparl start --port 8010 --cpu_num 32
33 34
```

F
fuyw 已提交
35 36 37 38
Note that if you have started a master before, you don't have to run the above
command. For more information about the cluster, please refer to our
[documentation](https://parl.readthedocs.io/en/latest/parallel_training/setup.html)

B
Bo Zhou 已提交
39
Then we can start the distributed training by running:
F
fuyw 已提交
40 41

```bash
B
Bo Zhou 已提交
42
python train.py
F
fuyw 已提交
43
```
44 45

### Reference
F
fuyw 已提交
46
+ [Parl Cluster Setup](https://parl.readthedocs.io/en/latest/parallel_training/setup.html).
47 48
+ [deepmind/scalable_agent](https://github.com/deepmind/scalable_agent)
+ [Ray](https://github.com/ray-project/ray)