FareedKhan-dev/all-rl-algorithms
Implementation of all RL algorithms in a simpler way
What it solves
This repository solves the problem of learning reinforcement learning (RL) by providing clear, readable implementations of 19 algorithms written from scratch in Python. Instead of relying on high-level RL libraries, each algorithm is built with basic tools like NumPy and PyTorch, so you can see exactly how the math and logic work under the hood. It helps you move from reading about RL to actually understanding and experimenting with each method.
How it works
Each algorithm lives in its own Jupyter notebook, which walks you through the theory, the code, and visualizations like learning curves and policy grids. The code is deliberately simplified to mirror the mathematical description of each algorithm, and notebooks include comments explaining every step. There is also a comprehensive cheat sheet summarizing key concepts, formulas, and pseudocode. The repository is designed as an interactive textbook: you can tweak hyperparameters, modify environments, and watch how the agent's behaviour changes.
Who it’s for
This is for anyone who wants to learn reinforcement learning deeply—students, self‑taught developers, researchers, or practitioners who prefer hands‑on code over abstract library calls. It is beginner‑friendly, with step‑by‑step explanations and a progression from basic to advanced algorithms, but even experienced users can benefit from the clear implementations and the cheat sheet.
Highlights
- 19 algorithms ranging from simple exploration and Q‑learning to advanced methods like PPO, SAC, TRPO, and multi‑agent approaches (MADDPG, QMIX).
- Every notebook includes visualizations—learning curves, Q‑table heatmaps, policy grids—to make the learning process tangible.
- A dedicated cheat sheet (cheatsheet.md) provides quick reference for formulas, hyperparameters, and pros/cons.
- The code is intentionally simple and readable, with comments that explain each function and variable.
- Contributions are welcome, and the project includes automated tests and CI to ensure notebooks run correctly.
- All notebooks were re‑run from scratch after bug fixes in version 1.0.0, so the outputs match the code.
Related
- Project
- Project
- Project
- Project