minimalRL is a lightweight reinforcement learning repository that implements several classic algorithms using minimal PyTorch code. The project is designed primarily as an educational resource that demonstrates how reinforcement learning algorithms work internally without the complexity of large frameworks. Each algorithm implementation is contained within a single file and typically ranges from about 100 to 150 lines of code, making it easy for learners to inspect the entire implementation at once. The repository includes examples of widely used reinforcement learning methods such as REINFORCE, Deep Q-Networks, Proximal Policy Optimization, and Actor-Critic architectures. Most experiments are designed to run quickly using the CartPole environment so that users can focus on understanding algorithm logic rather than computational infrastructure.
Features
- Minimal PyTorch implementations of major reinforcement learning algorithms
- Single-file code implementations for clarity and educational purposes
- Support for algorithms such as DQN, PPO, REINFORCE, A3C, and SAC
- Fast training examples using the CartPole-v1 environment
- Code structure designed for quick experimentation and modification
- Simple dependency requirements including PyTorch and OpenAI Gym