Skip to content
StackDecode
AI & ML Atlas
Reinforcement LearningalgorithmInteractive simulation

TD(0)

The simplest TD method: look one step ahead.

The idea

TD(0) uses a one-step target r + γ V(s′). It is the extreme "short lookahead" end of a spectrum whose other end is Monte Carlo (full lookahead). Learning is incremental and cheap.

V(s) ← V(s) + α [r + γ V(s′) − V(s)]

Watch it run

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

GOAL +1PIT −1start0000000000000-0.020000
  • positive value
  • negative value
  • agent

TD(0): after one step, move V(state) a bit toward reward + γ·V(next state) = -0.04.

episode:
1
1/78

The agent wanders randomly; we are only measuring how good each cell is.

Step by step

  1. 1Observe (s, r, s′).
  2. 2Compute the TD error.
  3. 3Update V(s) += α × TD error.
  4. 4Repeat.

Where it is used

Policy evaluation of a fixed policy.

Watch out for

Information propagates back only one step per visit, so credit assignment is slow.

Related