I used the tf_agents framework to implement a Reinforce Agent in python based on a custom environment. I mostly followed the following tutorial: https://www.tensorflow.org/agent