RepositoryPython
YuvrajSingh-mist

YuvrajSingh-mist/NeatRL

Readable single-file PyTorch implementations of deep RL algorithms

241stars
22forks
0issues
2views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: actor-critic

#1 Repository of the week

1
TINIX TRENDING·Topic: experience-replay

#1 Repository of the week

1
TINIX TRENDING·Topic: dqn

#1 Repository of the week

NeatRL

A collection of one-file reinforcement learning algorithm implementations, plus a packaged library for drop-in training.

Repository Layout

NeatRL/
  neatrl/          # Installable Python library
  experiments/     # Standalone single-file scripts (one per algorithm/env)

NeatRL Library

The neatrl/ directory is a pip-installable package that exposes clean train_* functions for each algorithm.

pip install neatrl

# Optional environment extras
pip install neatrl[atari]    # Atari games
pip install neatrl[box2d]    # BipedalWalker, LunarLander
pip install neatrl[classic]  # CartPole, Pendulum, FrozenLake
pip install neatrl[mujoco]   # HalfCheetah, Ant, Humanoid

Supported Algorithms

AlgorithmFunctionAction Space
DQNtrain_dqnDiscrete
Dueling DQNtrain_dueling_dqnDiscrete
REINFORCEtrain_reinforce, train_reinforce_cnnDiscrete / Continuous
A2Ctrain_a2c, train_a2c_cnnDiscrete / Continuous
PPOtrain_ppo, train_ppo_cnnDiscrete / Continuous
PPO-RNDtrain_ppo_rnd, train_ppo_rnd_cnnDiscrete / Continuous
DDPGtrain_ddpg, train_ddpg_cnnContinuous
TD3train_td3, train_td3_cnnContinuous
SACtrain_sac, train_sac_cnnContinuous

Quick Start

from neatrl import train_dqn

model = train_dqn(
    env_id="CartPole-v1",
    total_timesteps=10000,
    seed=42
)
from neatrl import train_ppo

model = train_ppo(
    env_id="LunarLander-v3",
    total_timesteps=500000,
    n_envs=4,
    use_wandb=True,
    seed=42
)
from neatrl import train_sac

model = train_sac(
    env_id="HalfCheetah-v5",
    total_timesteps=1000000,
    use_wandb=True,
    seed=42
)

Full documentation: neatrl/README.md

Experiments

The experiments/ directory contains standalone scripts -- each file is a self-contained implementation written for a specific algorithm or environment before it was absorbed into the library. Useful as reference or for one-off runs.

experiments/
  DQN/              CartPole, LunarLander
  DQN-atari/        Atari with CNN
  DQN-FrozenLake/   FrozenLake with one-hot encoding
  DQN-Lunar/        LunarLander-specific tuning
  DQN-Taxi/         Taxi-v3
  DQN-flappy/       FlappyBird
  Duel-DQN/         Dueling DQN on CliffWalking
  Q-Learning/       Tabular Q-learning
  REINFORCE/        CartPole, Pendulum
  A2C/              Acrobot, LunarLander, CarRacing
  PPO/              LunarLander, BipedalWalker, Atari
  FlappyBird-PPO/   PPO on FlappyBird
  DDPG/             HalfCheetah, BipedalWalker
  TD3/              HalfCheetah, BipedalWalker, Atari
  SAC/              HalfCheetah, BipedalWalker, discrete
  RND/              CliffWalking, CarRacing (curiosity-driven)
  MARL/             Multi-agent RL
  GRPO/             Group Relative Policy Optimization
  Imitation Learning/  Behavioral cloning
  VizDoom-RL/       3D first-person environments

License

MIT

Similar Projects

Discover other similar projects and AI models.

RepositoryPython
MushroomRL/mushroom-rl

Python library for Reinforcement Learning.

948
Nov 28, 2026
RepositoryPython
TianhongDai/reinforcement-learning-algorithms

This repository contains most of pytorch implementation based classic deep reinforcement learning algorithms, including - DQN, DDQN, Dueling Network, DDPG, SAC, A2C, PPO, TRPO. (More algorithms are still in progress)

697
Dec 18, 2025
RepositoryPython
Skylark0924/Machine-Learning-is-ALL-You-Need

🔥🌟《Machine Learning 格物志》: ML + DL + RL basic codes and notes by sklearn, PyTorch, TensorFlow, Keras & the most important, from scratch!💪 This repository is ALL You Need!

423
Aug 25, 2023
RepositoryPython
thu-ml/tianshou

An elegant PyTorch deep reinforcement learning library.

11.1k
Dec 1, 2026
RepositoryPython
vwxyzjn/cleanrl

High-quality single file implementation of Deep Reinforcement Learning algorithms with research-friendly features (PPO, DQN, C51, DDPG, TD3, SAC, PPG)

10.7k
Apr 20, 2026
RepositoryPython
MorvanZhou/Reinforcement-learning-with-tensorflow

Simple Reinforcement learning tutorials, 莫烦Python 中文AI教学

9.5k
Mar 31, 2024
RepositoryPython
sweetice/Deep-reinforcement-learning-with-pytorch

PyTorch implementation of DQN, AC, ACER, A2C, A3C, PG, DDPG, TRPO, PPO, SAC, TD3 and ....

4.6k
Mar 24, 2023
RepositoryPython
rlcode/reinforcement-learning

Minimal and Clean Reinforcement Learning Examples

3.7k
Jun 12, 2026
RepositoryPython
kengz/SLM-Lab

Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".

1.4k
Nov 30, 2026