Awesome Open Source
Awesome Open Source


A Repository with C++ implementations of Reinforcement Learning Algorithms (Pytorch)

RlCpp is a reinforcement learning framework, written using the PyTorch C++ frontend.

RlCpp aims to be an extensible, reasonably optimized, production-ready framework for using reinforcement learning in projects where Python isn't viable. It should be ready to use in desktop applications on user's computers with minimal setup required on the user's side.

The Environment used is the C++ Port of Arcade Learning Environment

Currently Supported Models

The deep reinforcement learning community has made several independent improvements to the DQN algorithm. This repository presents latest extensions to the DQN algorithm:

  1. Playing Atari with Deep Reinforcement Learning [arxiv]
  2. Deep Reinforcement Learning with Double Q-learning [arxiv]
  3. Dueling Network Architectures for Deep Reinforcement Learning [arxiv]
  4. Prioritized Experience Replay [arxiv]
  5. Noisy Networks for Exploration [arxiv]
  6. A Distributional Perspective on Reinforcement Learning [arxiv]
  7. Rainbow: Combining Improvements in Deep Reinforcement Learning [arxiv]
  8. Distributional Reinforcement Learning with Quantile Regression [arxiv]
  9. Hierarchical Deep Reinforcement Learning: Integrating Temporal Abstraction and Intrinsic Motivation [arxiv]
  10. Neural Episodic Control [arxiv]

Results for Pong using Double DQN

Environments (All Atari Environments)

  1. Breakout
  2. Pong
  3. Montezuma's Revenge (Current Research)
  4. Pitfall
  5. Gravitar
  6. CarRacing

Installing the dependencies

Arcade Learning Environment

Install main dependences:

sudo apt-get install libsdl1.2-dev libsdl-gfx1.2-dev libsdl-image1.2-dev cmake


$ mkdir build && cd build
$ make -j 4

To install python module:

$ pip install .
$ pip install --user .

Getting the ALE to work on Visual Studio requires a bit of extra wrangling. You may wish to use IslandMan93's Visual Studio port of the ALE.

To ask questions and discuss, please join the ALE-users group.



CMake is used for the build system. Most dependencies are included as submodules (run git submodule update --init --recursive to get them). Libtorch has to be installed seperately.

cd Reinforcement_CPP
cd build
cmake ..
make -j4

Before running, make sure to add libtorch/lib to your PATH environment variable.

Changes to cmake file

The CMake file requires some changes for things to run smoothly.

  1. After building ALE, link the
  2. Set torch dir, after building libtorch. Refer to the current CMakeLists.txt and make the relevant changes.

Future Plans

Plans to support:

  1. Runtime differences between C++ and Python.
  2. Python bindings for the Trainer module.
  3. More models and methods.
  4. Support for mujoco environment.

Stay tuned !

Alternatives To Pytorch Rl Cpp
Select To Compare

Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Python (794,040
C Plus Plus (235,679
Cpp (235,671
Learning (76,510
Google (36,874
Machine Learning (36,415
Deep Learning (35,914
Deep (35,914
Tensorflow (22,270
Pytorch (20,711
Keras (10,418
Gan (5,123
Robotics (5,079
Reinforcement Learning (4,345
Deep Neural Networks (3,823
Gym (2,502
Openai (1,538
Dqn (1,409
Atari (1,247
Vae (1,096
Openai Gym (693
Mujoco (484
Deepmind (409
Reinforcement Learning Algorithms (291