seungeunrho/minimalRL
Implementations of basic RL algorithms with minimal lines of codes! (pytorch based)
repo name | seungeunrho/minimalRL |
repo link | https://github.com/seungeunrho/minimalRL |
homepage | |
language | Python |
size (curr.) | 54 kB |
stars (curr.) | 1329 |
created | 2019-04-23 |
license | MIT License |
minimalRL-pytorch
Implementations of basic RL algorithms with minimal lines of codes! (PyTorch based)
-
Each algorithm is complete within a single file.
-
Length of each file is up to 100~150 lines of codes.
-
Every algorithm can be trained within 30 seconds, even without GPU.
-
Envs are fixed to “CartPole-v1”. You can just focus on the implementations.
Algorithms
- REINFORCE (67 lines)
- Vanilla Actor-Critic (98 lines)
- DQN (112 lines, including replay memory and target network)
- PPO (119 lines, including GAE)
- DDPG (147 lines, including OU noise and soft target update)
- A3C (129 lines)
- ACER (149 lines)
- A2C added! (188 lines)
- Any suggestion ..?
Dependencies
- PyTorch
- OpenAI GYM
Usage
# Works only with Python 3.
# e.g.
python3 REINFORCE.py
python3 actor_critic.py
python3 dqn.py
python3 ppo.py
python3 ddpg.py
python3 a3c.py
python3 a2c.py
python3 acer.py