Skip to main content
MahiDev — Learn. Build. Become AI-ready.

Lesson 61

Dueling DQN

Split the Q-network into a state value and action advantages, then recombine them into action scores. One example is on this page.

Intermediate12 min
Dueling DQN MahiDev

What You Will Learn

  • Idea
  • Example
  • When to use it

Idea

In many states the action barely matters and the state itself is good or bad. A dueling network learns a value for the state and an advantage for each action. Q is the value plus the advantage, with the average advantage removed so the two streams stay identifiable.

Example

python
value = 3.0
advantages = [1.0, -1.0]
mean_advantage = sum(advantages) / len(advantages)
q_values = [value + m - mean_advantage for m in advantages]
print([round(m, 2) for m in q_values])

Output:

text
[4.0, 2.0]

When to use it

  • Use it when many actions in a state are similar and only a few change the return.
  • Subtracting the mean advantage keeps value and advantage from trading off freely.
  • It is a network shape. The DQN or Double DQN target can stay the same.

Loading playground…