Awesome Open Source
Awesome Open Source

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

  1. REINFORCE (67 lines)
  2. Vanilla Actor-Critic (98 lines)
  3. DQN (112 lines, including replay memory and target network)
  4. PPO (119 lines, including GAE)
  5. DDPG (145 lines, including OU noise and soft target update)
  6. A3C (129 lines)
  7. ACER (149 lines)
  8. A2C (188 lines)
  9. SAC (171 lines) added!!
  10. PPO-Continuous (161 lines) added!!
  11. Vtrace (137 lines) added!!
  12. Any suggestion ...?

Dependencies

  1. PyTorch
  2. 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
python3 sac.py
Alternatives To Minimalrl
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (891,361
Machine Learning (40,927
Deep Learning (39,340
Algorithms (38,042
Pytorch (22,655
Line (17,724
Reinforcement Learning (4,882
Rl (2,335
Dqn (1,426
Deep Reinforcement Learning (1,116
Ppo (632
Ddpg (545
A3c (314
Policy Gradient (302
A2c (108
Sac (107
Acer (34
Reinforce (30