A collection of PyTorch implementations of distributed reinforcement learning algorithms, designed with clarity and educational value in mind.
- Clear, documented implementations of state-of-the-art distributed RL algorithms
- Educational focus with detailed comments and explanations
- Modular design for easy extension and modification
- Comprehensive logging with Weights & Biases integration
- Configurable experiments using Hydra
An implementation based on "Asynchronous Methods for Deep Reinforcement Learning" (Mnih et al., 2016).
Key Features:
- ✨ Parallel training across multiple workers
- 🎯 Shared model architecture with target network
- 🔍 Epsilon-greedy exploration with annealing
- 📉 Learning rate annealing
- 📊 Wandb integration for experiment tracking
distributed_rl_algos/
├── algorithms/ # Algorithm implementations
│ └── adqn.py # Asynchronous DQN implementation
├── common/ # Shared utilities
│ ├── network_factory.py
│ └── utils.py
└── config/ # Configuration files
└── adqn.yaml # ADQN hyperparameters
- Clone the repository:
git clone https://github.com/yourusername/distributed_rl_algos.git
cd distributed_rl_algos
- Install dependencies with Poetry:
poetry install
poetry shell
- Python 3.8+
- PyTorch
- Gymnasium
- Weights & Biases
- Poetry
- Hydra
Run the algorithm with default configurations:
python examples/train.py algorithm=adqn
num_workers
: Number of parallel workersnetwork.architecture
: Neural network architecturetraining.lr
: Learning ratetraining.epsilon
: Exploration parameterstraining.duration
: Training duration
# Format code
poetry run black .
poetry run isort .
# Run linting
poetry run pylint distributed_rl_algos
# Run tests
poetry run pytest
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
If you use this code in your research, please cite:
@misc{distributed_rl_algos,
author = {Your Name},
title = {Distributed Reinforcement Learning Algorithms},
year = {2024},
publisher = {GitHub},
url = {https://github.com/yourusername/distributed_rl_algos}
}
- The A3C-DQN implementation is based on the work by Mnih et al.
- Thanks to all contributors who have helped improve this project