Skip to content
StackDecode
AI & ML Atlas
Reinforcement LearningalgorithmInteractive simulation

Actor-Critic Algorithm

An actor picks actions while a critic judges them, reducing variance.

The idea

The actor is the policy; the critic learns a value function. Instead of waiting for the full return, the actor uses the critic's one-step TD error as its learning signal: positive means the action was better than expected. Learning is online and far less noisy than REINFORCE.

actor: θ ← θ + α δ ∇log π, critic: V ← V + β δ

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. 1The actor chooses an action from the current state.
  2. 2Observe the reward and next state.
  3. 3The critic computes the TD error δ = r + γV(s′) − V(s).
  4. 4Update the critic toward the target and the actor along δ·∇ log π.

Where it is used

The template for A2C, PPO, DDPG and SAC.

Watch out for

A bad critic misleads the actor; two learners must be balanced.

Related