Skip to content

Latest commit

 

History

History
37 lines (25 loc) · 1.13 KB

README.md

File metadata and controls

37 lines (25 loc) · 1.13 KB

TD3-Pytorch-C++-

TD3 deep reinforcement learning algorithm using C++/libtorch in simple environment of finding shortest distance between two points. The environment is taken from https://github.com/mhubii/ppo_libtorch

This is an implementation of the twin-delayed deep deterministic (TD3) policy gradient algorithm for the C++ API of Pytorch. It uses a simple TestEnvironment to test the algorithm. Below is a small visualization of the environment, the algorithm is tested in.

This is an image

Fig. 1: The agent in training during epoch 30.

You first need to install LibTorch. I used the version 1.4.0+cpu.

Do

mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH=/absolut/path/to/libtorch ..
make

Run

Run the executable with

cd build
./train_ppo

It should produce something like shown below.

This is an image This is an image

Fig. 2: From left to right, the agent for successive epochs in training mode as it takes actions in the environment to reach the goal.

Visualization

The results are saved to data/data.csv and can be visualized by running python plot.py.