Skip to content
StackDecode
AI & ML Atlas
Reinforcement LearningalgorithmInteractive simulation

Vanilla Policy Gradient

The plain policy-gradient update with no trust region or natural gradient.

The idea

It simply follows the sampled gradient E[∇ log π · A] with a fixed learning rate on the policy parameters. It is the simplest member of the family and the easiest to implement, but a step that is small in parameter space may change the policy a lot, so learning can be unstable.

Watch it run

This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.

action 1true reward 0.425%action 2true reward 0.625%action 3true reward 0.125%action 4true reward 0.925%
  • probability of action
  • sample pushed up
  • sample pushed down

The policy starts uniform: every action is equally likely.

iteration:
0
expected reward:
0.5
1/41

Dots under each bar are the sampled actions in the latest batch.

Step by step

  1. 1Collect trajectories.
  2. 2Estimate advantages.
  3. 3Compute the average of ∇ log π(a|s)·A.
  4. 4Apply a plain gradient step.

Where it is used

A baseline for policy optimisation.

Watch out for

Sensitive to the learning rate; PPO and TRPO were invented to fix this.

Related