A repository for implementing & experimenting with reinforcement learning (RL) algorithms — built and maintained by @undextrois.
This project provides implementations of key reinforcement-learning algorithms (both classic and deep-RL), suitable for study, experimentation, benchmarking and extension. Whether you’re learning RL, researching, or building prototypes — this repo gives you a launch pad.
Key goals:
- Provide clean, readable implementations of RL algorithms.
- Support standard environments (e.g., via OpenAI Gym) for reproducible results.
- Enable extension: add new algorithms, environments, hyper-parameters.
- Offer scripts and notebooks for experimentation & visualization.
/
├── algorithms/ ← source code for each RL algorithm
├── envs/ ← environment wrappers, helper utilities
├── experiments/ ← experiment scripts, configuration files
├── notebooks/ ← Jupyter notebooks for demonstration & exploration
├── tests/ ← unit/integration tests
├── requirements.txt ← Python dependencies
└── README.md ← you’re reading it!
Below is a non-exhaustive list of RL methods included (or planned):
- Tabular methods: Value Iteration, Policy Iteration (Markov Decision Processes)
- Monte Carlo prediction & control
- Temporal Difference (TD) learning: SARSA, Q-Learning
- Function Approximation (linear, maybe simple neural nets)
- Deep RL: Deep Q-Networks (DQN), Double DQN, (optionally) Dueling DQN / Prioritized Experience Replay
- Policy Gradient methods: REINFORCE, Actor-Critic, (optionally) Proximal Policy Optimization (PPO)
- Exploration methods: ε-greedy, Upper-Confidence Bounds (UCB) for bandits / RL Note: if some algorithms above aren’t yet implemented, they may be marked as “WIP” or “planned”.
- Python 3.x (recommended 3.7+)
- virtualenv or conda (recommended)
pip install -r requirements.txt
git clone https://github.com/undextrois/reinforcement-learning.git
cd reinforcement-learning
pip install -r requirements.txt Here’s how you might run a simple algorithm/experiment:
python algorithms/q_learning.py --env FrozenLake-v1 --episodes 1000 --render Replace with correct script name & arguments as per your code.
Open notebooks/ in JupyterLab / Jupyter Notebook.
jupyter notebook notebooks/DQN_CartPole.ipynb Experiments are stored under experiments/. Each run creates a folder with the date/time, parameters used, results (e.g., cumulative reward, loss curves), and optionally saved models or logs.
You can quickly reproduce results by:
python experiments/run_experiment.py --config experiments/configs/dqn_cartpole.yaml Modern usage: tweak the config file, rerun, check results/ folder.
Want to add a new algorithm or environment? Here’s how:
- Create a new file in
algorithms/your_algorithm.pyimplementing the RL agent class. - Add associated config under
experiments/configs/your_algorithm_*.yaml. - Write or update a notebook under
notebooks/to demonstrate usage. - Add unit tests in
tests/to validate the new algorithm. - Submit a pull request / version bump if you intend to share.
- More advanced Deep RL algorithms: PPO, A3C, SAC
- Support for continuous-action environments (e.g., MuJoCo, Unity ML-Agents)
- Better logging & visualization: TensorBoard / Weights & Biases integration
- Hyper-parameter search (grid / random / Bayesian)
- Docker / reproducible environments for easier deployment
- Sutton, R. S. & Barto, A. G. (2018) Reinforcement Learning: An Introduction
- David Silver’s RL course (UCL / DeepMind)
- OpenAI Gym: toolkit for developing RL algorithms
- Various deep-RL research papers (DQN, PPO, SAC, etc.)
This project is released under the MIT License. Feel free to use, modify, and extend — attribution appreciated.
Contributions are welcome! To contribute:
- Fork the repo
- Create a feature branch (
git checkout -b feature/your-algorithm) - Make your changes (code, tests, notebook, documentation)
- Submit a Pull Request and describe your changes
- Ensure all tests pass, code quality maintained
Thank you for your interest and contributions!
Happy Reinforcement Learning! — @undextrois