Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Policy Gradient algorithms (REINFORCE, NPG, TRPO, PPO)
| Date | Stars |
|---|---|
| 2026-07-31 | 371 |
| 2026-08-01 | 371 |
| 2026-08-02 | 371 |
| 2026-08-06 | 371 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Policy Gradient (PG) Algorithms

This repository contains PyTorch (v0.4.0) implementations of typical policy gradient (PG) algorithms.
* Vanilla Policy Gradient [[1](#1)]
* Truncated Natural Policy Gradient [[4](#4)]
* Trust Region Policy Optimization [[5](#5)]
* Proximal Policy Optimization [[7](#7)].
We have implemented and trained the agents with the PG algorithms using the following benchmarks. Trained agents and Unity ml-agent environment source files will soon be available in our repo!
* mujoco-py: [https://github.com/openai/mujoco-py](https://github.com/openai/mujoco-py)
* Unity ml-agent: [https://github.com/Unity-Technologies/ml-agents](https://github.com/Unity-Technologies/ml-agents)
For reference, solid reviews of below papers related to PG (in Korean) are located in https://reinforcement-learning-kr.github.io/2018/06/29/0_pg-travel-guide/. Enjoy!
<a name="1"></a>
* [1] R. Sutton, et al., "Policy Gradient Methods for Reinforcement Learning with Function Approximation", NIPS 2000.
<a name="2"></a>
* [2] D. Silver, et al., "Deterministic Policy Gradient Algorithms", ICML 2014.
<a name="3"></a>
* [3] T. Lillicrap, et al., "Continuous Control with Deep Reinforcement Learning", ICLR 2016.
<a name="4"></a>
* [4] S. Kakade, "A Natural Policy Gradient", NIPS 2002.
<a name="5"></a>
* [5] J. Schulman, et al., "Trust Region Policy Optimization", ICML 2015.
<a name="6"></a>
* [6] J. Schulman, et al., "High-Dimensional Continuous Control using Generalized Advantage Estimation", ICLR 2016.
<a name="7"></a>
* [7] J. Schulman, et al., "Proximal Policy Optimization Algorithms", arXiv, https://arxiv.org/pdf/1707.06347.pdf.
Table of Contents
<!-- @import "[TOC]" {cmd="toc" depthFrom=1 depthTo=6 orderedList=false} -->
<!-- code_chunk_output -->
* [Policy Gradient (PG) Algorithms](#policy-gradient-pg-algorithms)
* [Mujoco-py](#mujoco-py)
* [1. Installation](#1-installation)
* [2. Train](#2-train)
* [Basic Usage](#basic-usage)
* [Continue training from the saved checkpoint](#continue-training-from-the-saved-checkpoint)
* [Test the pretrained model](#test-the-pretrained-model)
* [Modify the hyperparameters](#modify-the-hyperparameters)
* [3. Tensorboard](#3-tensorboard)
* [4. Trained Agent](#4-trained-agent)
* [Unity ml-agents](#unity-ml-agents)
* [1. Installation](#1-installation-1)
* [2. Environments](#2-environments)
* [3. Train](#3-train)
* [Basic Usage](#basic-usage-1)
* [Continue training from the saved checkpoint](#continue-training-from-the-saved-checkpoint-1)
* [Test the pretrained model](#test-the-pretrained-model-1)
* [Modify the hyperparameters](#modify-the-hyperparameters-1)
* [4. Tensorboard](#4-tensorboard)
* [5. Trained Agent](#5-trained-agent)
* [Reference](#reference)
<!-- /code_chunk_output -->
## Mujoco-py
### 1. Installation
* [Ubuntu](https://github.com/reinforcement-learning-kr/pg_travel/wiki/Installing-Mujoco-py-on-Linux)
### 2. Train
Navigate to `pg_travel/mujoco` folder
#### Basic Usage
Train the agent with `PPO` using `Hopper-v2` without rendering.
~~~
python main.py
~~~
* Note that models are saved in `save_model` folder automatically for every 100th iteration.
Train the agent with `TRPO` using `HalfCheetah` with rendering
~~~
python main.py --algorithm TRPO --env HalfCheetah-v2 --render
~~~
* **algorithm**: PG, TNPG, TRPO, **PPO**(default)
* **env**: Ant-v2, HalfCheetah-v2, **Hopper-v2**(default), Humanoid-v2, HumanoidStandup-v2, InvertedPendulum-v2, Reacher-v2, Swimmer-v2, Walker2d-v2
#### Continue training from the saved checkpoint
~~~
python main.py --load_model ckpt_736.pth.tar
~~~
* Note that `ckpt_736.pth.tar` file should be in the `pg_travel/mujoco/save_model` folder.
* Pass the arguments `algorithm` and/or `env` if not `PPO` and/or `Hopper-v2`.
#### Test the pretrained model
Play `5` episodes with the saved model `ckpt_738.pth.tar`
~~~
python test_algo.py --load_model ckpt_736.pth.tar --iter 5
~~~
* Note thatExcerpt of 9,210 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:f75f8048f5503552, llm:description: 'Policy Gradient algorithms (REINFORCE, NPG, TRPO, PPO)'
matched fp:f75f8048f5503552, llm:description: 'Policy Gradient algorithms (REINFORCE, NPG, TRPO, PPO)'
matched fp:f75f8048f5503552, llm:description: 'Policy Gradient algorithms (REINFORCE, NPG, TRPO, PPO)'