Skip to content

1shin-7/rl_lab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deep Reinforcement Learning Lab (DRL Lab)

"Bridging theory and practice: An exploration from Markov Decision Processes to Rainbow DQN."

drl_lab is a modular, extensible Deep Reinforcement Learning (DRL) experimental platform designed to provide out-of-the-box implementations of classic control tasks with a modern debugging experience.

✨ Features

  • Modern Architecture: Built on PyTorch and Gymnasium, featuring a modular design for Agent, Task, and Trainer.
  • Rainbow DQN Integration:
    • Double DQN (DDQN): Mitigates Q-value overestimation.
    • Dueling Networks: Separates value and advantage streams for faster convergence.
    • Huber Loss: Gradient clipping for stability.
  • Interactive TUI: Terminal User Interface powered by Textual, enabling real-time visualization of training and inference (Braille animations, status dashboards, live logs).
  • Developer Friendly: Lifecycle hooks (pre_training, on_step, etc.) and a standardized BaseTask interface.
  • Practical Optimizations: Includes Reward Shaping for sparse reward tasks like CartPole.

🚀 Quickstart

Installation

This project uses uv for package management:

# Clone the repository
git clone https://github.com/1shin-7/rl_lab.git
cd rl_lab

# Sync dependencies
uv sync

Training

Start training the CartPole task with TUI visualization enabled:

uv run rlab train cartpole --visual --episodes 500

Inference

Run inference using a trained model:

uv run rlab infer cartpole --visual --weight outputs/cartpole.pth

Clean

Remove generated models and plots for a task:

uv run rlab clean cartpole

📚 Documentation

🤝 Credits

  • PyTorch: The backbone of the entire project, enabling flexible and efficient deep learning.
  • Gymnasium: Standardized RL environment API.
  • UI/UX: Textual, Loguru, and Rich were used to provide a convenient debugging interface.
  • Gemini: For assisting in problem-solving throughout the internship.

About

Deep Reinforcement Learning Lab, only for personal use

Topics

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages