pytorch-REINFORCE
pytorch-REINFORCE copied to clipboard
PyTorch Implementation of REINFORCE for both discrete & continuous control
PyTorch REINFORCE
![](https://github.com/chingyaoc/pytorch-REINFORCE/raw/master/assets/algo.png)
PyTorch implementation of REINFORCE.
This repo supports both continuous and discrete environments in OpenAI gym.
Requirement
- python 2.7
- PyTorch
- OpenAI gym
- Mujoco (optional)
Run
Use the default hyperparameters. (Program will detect whether the environment is continuous or discrete)
python main.py --env_name [name of environment]
Experiment results
continuous: InvertedPendulum-v1
![](https://github.com/chingyaoc/pytorch-REINFORCE/raw/master/assets/InvertedPendulum-v1.png)
discrete: CartPole-v0
![](https://github.com/chingyaoc/pytorch-REINFORCE/raw/master/assets/CartPole-v0.png)