Reinforcement Learning Project
A collection of reinforcement learning agents, written from scratch to learn how they work, and used to solve classic control and game problems from Gym environments such as Lunar Lander.
Why I built it
Writing each algorithm by hand was the best way to understand it. The code favors clarity over speed, so every piece is visible and easy to follow. If you want a working starting point with the internals exposed, this is for you. It is not a replacement for production libraries like TensorFlow, which are faster and more complete.
What's inside
- Agents: a hand-coded energy-pumping Mountain Car agent, a human-controlled agent (keyboard), Monte Carlo Q-learning, semi-gradient TD control (SARSA), and neural network agents including a Deep Q-learner.
- Environments: Gym problems including Lunar Lander, Mountain Car, and Atari games.
- Building blocks: trainers, function approximators, replay models, and optimizers, kept separate so you can mix and match them.
Most agents train in 1–30 minutes. Google Colab works well if your computer is struggling.
Where to start
Run the Mountain Car agent to see how a Gym environment works, then try the human agent to play it yourself. After that, try the semi-gradient TD control agent, which solves most of the simple problems in about 500 iterations. Move on to the neural network agents when you're ready.
Learn more
- Source code on GitHub
- Reinforcement Learning: An Introduction (Sutton & Barto, free)
- Reinforcement Learning Specialization (Coursera, University of Alberta)