5.2.3 · D3Deep & Advanced RL

Worked examples — Target networks

2,918 words13 min readBack to topic

Prerequisite reading if any symbol below feels new: Deep Q-Networks (DQN), Bellman Equation, and the parent Target networks note.


First, the symbols — earned before use

Every example uses the same handful of quantities. Let's name them once, in plain words.

First, two words the whole page rests on: a state is "the situation the agent is in right now" (where the robot stands, what the game screen shows), and an action is "one of the moves the agent can choose" (go left, fire, move-to-shelf). A prime, as in and , just means "the next one" — the state you land in and an action you could take there.

The symbol means "look at for every possible next action and keep the biggest number." Picture a row of bars — one per action — and you point at the tallest.


The scenario matrix

Below is every distinct cell a target-network calculation can land in. Each worked example is tagged with the cell(s) it covers.

# Cell class What's special Covered by
C1 Non-terminal, positive reward, hard update the "vanilla" backup Ex 1
C2 Non-terminal, negative reward sign of flips the target down Ex 2
C3 Terminal state future term dropped, Ex 3
C4 Zero / degenerate: and pure regression, no bootstrap Ex 4
C5 Soft update (Polyak), one step EMA arithmetic, tracking speed Ex 5
C6 Limiting : and recovers "no target net" / "frozen forever" Ex 6
C7 Divergence demo: coupled vs frozen why freezing helps, numerically Ex 7
C8 Double DQN twist online selects, target evaluates Ex 8
C9 Real-world word problem full pipeline end-to-end Ex 9
C10 Exam twist: negative values in the max tallest bar can be negative Ex 10
Figure — Target networks

Figure 1 lays out the matrix as a grid. The horizontal axis is what kind of transition you're backing up (positive-reward, negative-reward, terminal, degenerate); the vertical axis is how the target network is updated (hard copy, soft Polyak, limiting/theory). Each coloured pin is one worked example dropped into the cell it exercises — the legend on the figure maps every colour to its example number, so you can see at a glance that the ten examples together fill every cell.


Worked examples


Recall Quick self-test (cover the right side)

Vanilla target, , frozen , so ::: Same but terminal ::: Soft update gives ::: means ::: no target network (instant copy) Double DQN with online argmax , target, ::: Max of ::: (closest to zero)


Connections

  • Deep Q-Networks (DQN) — the base algorithm these numbers live inside.
  • Bellman Equation — the backup every target is a snapshot of.
  • Experience Replay — the other stabiliser; supplies the transitions we compute for.
  • Double DQN — Ex 8's decoupling trick.
  • DDPG / TD3 / SAC — soft-update (Ex 5) users.
  • Deadly Triad — Ex 7 is a miniature of the divergence it warns about.
  • Two-Timescale Stochastic Approximation — the theory behind Ex 6's slow .