Imported from https://github.com/neilsgp/RL-Algorithms