Skip to content

Deep reinforcement learning algorithms implemented using PyTorch, including DQN、DDPG、PPO、SAC、DDQN、Noisy-DQN.

Notifications You must be signed in to change notification settings

cloudpetticoats/deep-reinforcement-learning

Repository files navigation

🤩 Minimal abstraction, Beginner-friendly 😘

1.Introduction

This repository provides clean and robust implementations of common Deep Reinforcement Learning (DRL) algorithms.

If you have any questions about the code, feel free to submit an issue or contact me via my email (available on my homepage).

To do List

  • DQN – Implementation complete
  • Double-DQN – Implementation complete
  • Dueling-DQN – Implementation complete
  • Noisy-DQN – Implementation complete
  • DDPG – Implementation complete
  • PPO-Discrete – Implementation complete
  • PPO-Continuous – Implementation complete
  • SAC – Implementation complete
  • 🚧 DSAC – In progress
  • 🚧 MADDPG – In progress

2.Usage

It is super easy to use our DRL algorithms. If you just want to test the performance, please see 2.3. If you want to train the model yourself, please see 2.4.

2.1 Download Repo Code

Run the following command in your terminal to download this repository to your local.

git clone https://github.com/cloudpetticoats/deep-reinforcement-learning.git

2.2 Configure the Environment

We are using common dependencies, so version issues are unlikely to occur. You can directly use your existing environment. Don't need the same version as me.

But if you encounter any environment issues, here is my environment for reference.

Python 3.9
PyTorch 2.6.0
Gym 0.26.2
Matplotlib 3.9.1

2.3 For Testing

If you don't want to train the model yourself, we have already provided the trained models in the ./models/ folder of each algorithm. You can run test.py directly for visualization testing.

2.4 For Training

If you want to train the model yourself, go to each algorithm folder and run main.py to train. The trained model will be saved in the ./models/ folder. Then, run test.py to perform visualization testing.

3.Performance

We tested our code in the Gym, and the results are as follows.

CartPole-v1(DQN)
Image 1
CartPole-v1(Double-DQN)
Image 2
CartPole-v1(Dueling-DQN)
Image 3
CartPole-v1(Noisy-DQN)
Image 7
Pendulum-v1(DDPG)
Image 4
CartPole-v0(PPO-Discrete)
Image 5
Pendulum-v1(PPO-Continuous)
Image 6
Pendulum-v1(SAC)
Image 7

4.Reference

4.1 Related Paper

4.2 Excellent Weblog

4.3 Excellent Web

4.4 Excellent Course

⭐️ Star History

Star History Chart

About

Deep reinforcement learning algorithms implemented using PyTorch, including DQN、DDPG、PPO、SAC、DDQN、Noisy-DQN.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages