Lesson 65
A2C
Train an actor on the advantage, the gap between the return and a learned value, and average several workers in sync. One example is on this page.
Intermediate12 min
What You Will Learn
- Idea
- Example
- When to use it
Idea
Advantage Actor-Critic subtracts a baseline from the return. The advantage is how much better this action was than the critic's expected value. Synchronous A2C collects several workers, averages their updates, and then steps the shared model once.
Example
ret, value = 1.0, 0.4
advantage = ret - value
print(f"advantage: {advantage:.2f}")Output:
advantage: 0.60When to use it
- Use it when a plain REINFORCE update swings too much from episode to episode.
- An advantage near zero means the action was ordinary. The actor barely moves.
- The workers wait for each other. A3C removes that wait.
Loading playground…