Coder Social home page Coder Social logo

sonsang / cleanrl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from vwxyzjn/cleanrl

0.0 0.0 0.0 20.59 MB

High-quality single file implementation of Deep Reinforcement Learning algorithms with research-friendly features

Home Page: http://benchmark.cleanrl.dev

License: MIT License

Python 91.32% Shell 7.52% Dockerfile 0.25% HCL 0.91%

cleanrl's Introduction

CleanRL (Clean Implementation of RL Algorithms)

Meeting Recordings : cleanrl

CleanRL is a Deep Reinforcement Learning library that provides high-quality single-file implementation with research-friendly features. The implementation is clean and simple, yet we can scale it to run thousands of experiments using AWS Batch. The highlight features of CleanRL are:

  • ๐Ÿ“œ Single-file implementation
    • Every detail about an algorithm is put into the algorithm's own file. It is therefore easier to fully understand an algorithm and do research with.
  • ๐Ÿ“Š Benchmarked Implementation (7+ algorithms and 34+ games at https://benchmark.cleanrl.dev)
  • ๐Ÿ“ˆ Tensorboard Logging
  • ๐Ÿช› Local Reproducibility via Seeding
  • ๐ŸŽฎ Videos of Gameplay Capturing
  • ๐Ÿงซ Experiment Management with Weights and Biases
  • ๐Ÿ’ธ Cloud Integration with docker and AWS

Good luck have fun ๐Ÿš€

Get started

Prerequisites:

To run experiments locally, give the following a try:

git clone https://github.com/vwxyzjn/cleanrl.git && cd cleanrl
poetry install

# alternatively, you could use `poetry shell` and do
# `python run cleanrl/ppo.py`
poetry run python cleanrl/ppo.py \
    --seed 1 \
    --gym-id CartPole-v0 \
    --total-timesteps 50000

# open another temrminal and enter `cd cleanrl/cleanrl`
tensorboard --logdir runs

To use experiment tracking with wandb, run

wandb login # only required for the first time
poetry run python cleanrl/ppo.py \
    --seed 1 \
    --gym-id CartPole-v0 \
    --total-timesteps 50000 \
    --track \
    --wandb-project-name cleanrltest

To run training scripts in other games:

# atari
poetry shell
poetry install -E atari
AutoROM
python cleanrl/dqn_atari.py --gym-id BeamRiderNoFrameskip-v4
python cleanrl/c51_atari.py --gym-id BeamRiderNoFrameskip-v4
python cleanrl/ppo_atari.py --gym-id BeamRiderNoFrameskip-v4
# pybullet
poetry install -E pybullet
python cleanrl/td3_continuous_action.py --gym-id MinitaurBulletDuckEnv-v0
python cleanrl/ddpg_continuous_action.py --gym-id MinitaurBulletDuckEnv-v0
# procgen
poetry install -E procgen
python cleanrl/ppo_procgen.py --gym-id starpilot
<!-- # pettingzoo
poetry install -E pettingzoo
python cleanrl/ppo_pettingzoo.py -->

Algorithms Implemented

  • Deep Q-Learning (DQN)
    • dqn.py
      • For discrete action space.
    • dqn_atari.py
      • For playing Atari games. It uses convolutional layers and common atari-based pre-processing techniques.
  • Categorical DQN (C51)
    • c51.py
      • For discrete action space.
    • c51_atari.py
      • For playing Atari games. It uses convolutional layers and common atari-based pre-processing techniques.
    • c51_atari_visual.py
      • Adds return and q-values visulization for dqn_atari.py.
  • Proximal Policy Gradient (PPO)
  • Soft Actor Critic (SAC)
  • Deep Deterministic Policy Gradient (DDPG)
  • Twin Delayed Deep Deterministic Policy Gradient (TD3)
  • Apex Deep Q-Learning (Apex-DQN)
    • apex_dqn_atari_visual.py
      • For playing Atari games. It uses convolutional layers and common atari-based pre-processing techniques.

Open RL Benchmark

Open RL Benchmark by CleanRL is a comprehensive, interactive and reproducible benchmark of deep Reinforcement Learning (RL) algorithms. It uses Weights and Biases to keep track of the experiment data of popular deep RL algorithms (e.g. DQN, PPO, DDPG, TD3) in a variety of games (e.g. Atari, Mujoco, PyBullet, Procgen, Griddly, MicroRTS). The experiment data includes:

Open RL Benchmark has over 1000+ experiments including runs from other projects, which is overwhelming to present in a single report. Instead, we present the results in separate reports. Please click on the links below to access them.

We hope it could bring a new level of transparency, openness, and reproducibility. Our plan is to benchmark as many algorithms and games as possible. If you are interested, please join us and contribute more algorithms and games. To get started, check out our contribution guide and our roadmap for the Open RL Benchmark

Cloud integration

Check out the documentation here

Support and get involved

We have a Discord Community for support. Feel free to ask questions. Posting in Github Issues and PRs are also welcome. Also our past video recordings are available at YouTube

Contribution

We have a short contribution guide here https://github.com/vwxyzjn/cleanrl/blob/master/CONTRIBUTING.md. Consider adding new algorithms or test new games on the Open RL Benchmark (https://benchmark.cleanrl.dev)

Big thanks to all the contributors of CleanRL!

Citing our project

Please consider using the following Bibtex entry:

@misc{cleanrl,
  author = {Shengyi Huang and Rousslan Dossa and Chang Ye},
  title = {CleanRL: High-quality Single-file Implementation of Deep Reinforcement Learning algorithms},
  year = {2020},
  publisher = {GitHub},
  journal = {GitHub repository},
  howpublished = {\url{https://github.com/vwxyzjn/cleanrl/}},
}

References

I have been heavily inspired by the many repos and blog posts. Below contains a incomplete list of them.

The following ones helped me a lot with the continuous action space handling:

cleanrl's People

Contributors

adamcakg avatar bentrevett avatar bragajj avatar chutaklee avatar dosssman avatar felipemartins96 avatar helges avatar jkterry1 avatar sudo-michael avatar vwxyzjn avatar yooceii avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.