seungeunrho/minimalRL
seungeunrho/minimalRL has 3,271 GitHub stars and 490 forks. GitHot measured +2 stars in 24 hours, +26 in 7 days, and +28 in 15 days. Last checked 2026-11-12 09:53 UTC. Last push 2023-04-22.
Implementations of basic RL algorithms in as few lines of code as possible (based on PyTorch).
Measured star growth
- in 24h
- +2
- in 7 days
- +26
- in 15 days
- +28
- in 1 month
- Update delayed
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
OriginalminimalRL-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 (145 lines, including OU noise and soft target update)
- A3C (129 lines)
- ACER (149 lines)
- A2C (188 lines)
- SAC (171 lines) added!!
- PPO-Continuous (161 lines) added!!
- Vtrace (137 lines) added!!
- Any suggestion ...?
Dependencies
- PyTorch
- OpenAI GYM ( > 0.26.2 IMPORTANT!! No longer support for the previous versions)
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
Explore related projects
tensorflow/tensorflow
An Open Source Machine Learning Framework for Everyone
201,584 starshuggingface/transformers
🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.
168,917 starsAUTOMATIC1111/stable-diffusion-webui
Stable Diffusion web UI
165,300 starsComfy-Org/ComfyUI
The most powerful and modular diffusion model GUI, api and backend with a graph/nodes interface. The fastest local inference engine in the world.
146,472 stars