Skip to content

TD3 reinforcement learning algorithm using libtorch in simple environment

Notifications You must be signed in to change notification settings

hrshl212/TD3-libtorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

TD3 reinforcement learning algorithm using libtorch in simple environment

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published