Skip to content

akashe/DeepReinforcementLearning

Repository files navigation

Deep RL algorithms implemented using Pytorch

Algo list:

  1. DQN
  2. Vanilla policy Gradient
  3. Deep Deterministic Policy Gradient
  4. Twin Delayed Deep Deterministic Policy Gradient
  5. Soft Actor Critic
  6. Proximal Policy Optimization - CLIP
Article on deeper Look into policy gradients

Experimental Results:

Algorithm Discrete Env: LunarLander-v2 Continuous Env: Pendulum-v0
DQN LunnarLander-DQN -
VPG LunarLander-VPG -
DDPG - Pendulum-DDPG
TD3 - Pendulum-TD3
SAC - Pendulum-SAC
PPO - Pendulum-PPO

Resources:

  1. RL course by David Silver
  2. Lecture slides for above course
  3. Spinning up by OpenAI
  4. More exhaustive RL guide by Deeny Britz

Installation:

Prerequisites:

  • Python 3.8+ (3.8.10 recommended)
  • pyenv (optional but recommended)
  • Homebrew (for macOS users)

Setup:

  1. Clone the repository:

    git clone https://github.com/akashe/DeepReinforcementLearning.git
    cd DeepReinforcementLearning
  2. Set up Python environment:

    # Option A: Using pyenv (recommended)
    pyenv install 3.8.10
    pyenv local 3.8.10
    
    # Option B: Using system Python 3.8+
    # Make sure you have Python 3.8+ installed
  3. Install system dependencies (for Box2D environments like LunarLander):

    # macOS:
    brew install swig
    
    # Ubuntu/Debian:
    sudo apt-get install swig
    
    # Other systems: install swig through your package manager
  4. Create and activate virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
  5. Install Python dependencies:

    pip install -r requirements.txt

Usage:

Just run the file/algorithm directly. There is no common structures between algorithms as I implemented them as I learnt them. Different algorithms are inspired from different sources.

Examples:

python ddpg.py          # Run DDPG on Pendulum-v1
python DQN.py           # Run DQN on LunarLander-v2
python td3.py           # Run TD3 on Pendulum-v1
python SoftActorCritic.py # Run SAC on Pendulum-v1

About

Deep RL implementations. DQN, SAC, DDPG, TD3, PPO and VPG implemented in pytorch. Tested Env: LunarLander-v2 and Pendulum-v0.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published