# Understanding the role of the target network in this DQN algorithm

I've found online this interesting algorithm:

From what I understand reading this algorithm, I can't figure out why I should "perform the opposite action" and consequently storing that second experience as then it is never used to update or doing anything else. Is this algorithm incorrect?

• It's used, they store both observations in $M$ and then they sample from it, just because they use notation $e_i = (o_i,a_i,r_i,o_{i+1})$ it doesn't mean they sample only observations from $\mathcal E$. – Brale May 28 at 8:50
• @Brale You're right, thanks! – aandre_90 May 28 at 9:01
• @Brale just another question on this algorithm: when computing $y_i$ they use the argmax operator but w.r.t the main DNN. I've seen other pseudo algorithm which include the target network that compute the action w.r.t the target netowrk. What is the difference? – aandre_90 Jun 3 at 7:42
• This is some variation of double Q learning, look up Deep Double Q Learning – Brale Jun 3 at 12:46