NeatRL

Readable single-file PyTorch implementations of deep RL algorithms

What is NeatRL?

Readable single-file PyTorch implementations of deep RL algorithms

Overview of NeatRL

What it is

NeatRL is a Python library for reinforcement learning algorithms. It provides readable single-file implementations of deep RL algorithms using PyTorch. The library supports Gymnasium environments and Atari games, and includes Weights & Biases integration for experiment tracking. It is designed for research and experimentation.

Key features

  • Single-file implementations: each algorithm is contained in one self-contained file.
  • Experiment tracking: built-in support for Weights & Biases logging.
  • Gymnasium compatible: works with Gymnasium environments.
  • Atari support: full support for Atari games with automatic CNN architectures.
  • Parallel training: vectorized environments for faster data collection.
  • Easy to extend: modular design for adding new algorithms.
  • Video recording: automatic video capture and WandB integration.

Use cases

  • Research and experimentation with reinforcement learning algorithms.
  • Training RL agents on discrete action space environments such as CartPole and FrozenLake.
  • Training RL agents on continuous control tasks such as Pendulum and HalfCheetah.
  • Training RL agents on Atari games with automatic preprocessing.
  • Comparing different algorithms (DQN, PPO, SAC, TD3, DDPG, A2C, etc.) on standard benchmarks.

Getting started

Install NeatRL via pip: bash pip install neatrl pip install 'neatrl[cli]' # Live terminal dashboard (rich, psutil) Optional environment extras: bash pip install 'neatrl[atari]' # Atari games (ALE) pip install 'neatrl[box2d]' # Box2D environments (LunarLander, BipedalWalker, …) pip install 'neatrl[classic]' # Classic control (CartPole, Pendulum, …) pip install 'neatrl[mujoco]' # MuJoCo continuous control Quick start example training DQN on CartPole: python from neatrl.dqn_mlp import train_dqn model = train_dqn(env_id='CartPole-v1', total_timesteps=10000, seed=42)

License and pricing

The code is licensed under Apache License 2.0. Documentation, diagrams, benchmark results and other non-code assets are licensed under CC BY 4.0. The project is open source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/yuvrajsingh-mistneatrl.svg)](https://yunodb.com/tools/yuvrajsingh-mistneatrl?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/yuvrajsingh-mistneatrl?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/yuvrajsingh-mistneatrl.svg" alt="Featured on YunoDB" height="20"></a>