Thanks for your interest in contributing to Reinforcement Learning 101!
Quick start:
./setup.sh native # Recommended for developmentManual setup:
# Create virtual environment
python3 -m venv .venv
source .venv/bin/activate
# Install dependencies
pip install -r requirements/requirements-base.txt
pip install -r requirements/requirements-torch-cpu.txt # Or cuda/rocm
# Run smoke tests
python scripts/smoke_test.pySee SETUP.md for detailed environment setup instructions.
- CLI-first design: All examples must be runnable Python scripts with
argparse - No notebooks: Maintain reproducibility and version control friendliness
- Rich logging: Use
richconsole for structured, readable output - Docstrings: Include usage examples at the top of each script
- Type hints: Recommended for function signatures
- Seed handling: Expose
--seedflag for reproducibility
Every example script should follow this pattern:
#!/usr/bin/env python3
"""
Brief description of what this script does.
Usage:
python script_name.py --episodes 100 --lr 1e-3
"""
import argparse
from rich.console import Console
console = Console()
def main():
parser = argparse.ArgumentParser(description="...")
parser.add_argument("--seed", type=int, default=42)
# ... more arguments
args = parser.parse_args()
# Set seeds
# Run algorithm
# Log results with rich.console
if __name__ == "__main__":
main()- Smoke test compatibility: Ensure examples run with minimal parameters
- Fast defaults: Default configs should complete in minutes, not hours
- Guard imports: Wrap optional dependencies (e.g., PyTorch) with try/except
try:
import torch
except ImportError:
console.print("[red]PyTorch required. Install with: pip install torch[/red]")
sys.exit(1)When adding new features:
- Update
docs/roadmap.mdif adding new capabilities - Add entry to relevant module's
content.md - Update
SETUP.mdif changing dependencies or setup process - Include usage examples in docstrings
If modifying Docker setup:
- Test all three backends:
cpu,cuda,rocm - Ensure image builds are optimized (use layer caching)
- Update
docker-compose.ymlif changing service configurations - Document any new environment variables in
SETUP.md
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Test your changes with smoke tests
- Commit with clear messages (
git commit -m 'Add amazing feature') - Push to your fork (
git push origin feature/amazing-feature) - Open a Pull Request with:
- Clear description of changes
- How to run/reproduce
- Expected output or behavior
- Any new dependencies
- Clarity over cleverness: This is a teaching repository
- Minimal dependencies: Avoid adding heavy libraries unless necessary
- Reproducibility: Seed handling and deterministic behavior where possible
- Short runtimes: Examples should validate quickly by default
- Educational value: Code should be readable and well-commented
Open an issue for:
- Bug reports
- Feature requests
- Documentation improvements
- Questions about contributing
Thank you for helping make RL more accessible! 🚀