I needed an implementation of Soft Actor-Critic in C++ for my work but couldn't find a suitable one, so I decided to create my own. The code is provided with a simple GridWorld environment and a main file to test the algorithm. I didn't have time to create a wrapper for Gym to test it.
JsonCpp and Libtorch are required. JsonCpp is already in the 'lib' folder. It seems there is a compatibility error between JsonCpp and Torch when using Cuda, so the Libtorch version I'm using is for CPU only. If you find out why, I would be happy to know :)
This code is based on the python implementation of philtabor, which you can find here: GitHub
Soft Actor-Critic Paper: Paper