Target networks: separate frozen network for computing TD targets. Breaks correlations between consecutive TD targets, stabilizing training.
The problem, from first principles
In DQN, Q-network updates the target used to compute the loss (bootstrapping). This creates moving targets, causing instability. Solution: use a separate frozen network to compute targets, update it periodically.
Or hard update if τ=1: target_params = network_params
Returns updated target network
Constraints
Typically τ small (0.001) for soft updates
Hard update every C steps is alternative
Must match architecture of main network
Hints
Hint 1: Soft update
target = (1 - tau) * target + tau * main
Hint 2: Parameter iteration
Apply to each parameter independently
Hint 3: No gradient needed
Target network params don't require gradients
Keywords
rldqndeep-learningstability
Python
Run your code to see results
No results yet
Run your code to check it against the examples, or submit to run every test.