what is difference between the DDQN and DQN? I think I did not understand what is the difference between DQN and DDQN in implementation. 
I understand that we change the traget network during the running of DDQN but I do not understand how it is done in this code.

We put the self.target_model.set_weights(self.model.get_weights()) 
In implementation of DDQN and this is added when action is finished for DQN  https://github.com/keon/deep-q-learning self.target_model.set_weights(self.model.get_weights()) is added to DQN in order to change the DQN to DDQN! But this happens when we are going out from running by break! There for there is no difference between them!

What is wrong in my mind? (Maybe the difference will be at test? Is this code for train and the test is done with setting the exploration rate=0  and then run this for just one episode with new weight we found? Is it right?

Therefore, what is difference between the presented DQN and DDQN of this link.
In particular, DQN is just Q-learning, which uses neural networks as a policy and use "hacks" like experience replay, target networks and reward clipping.

In original paper authors use convolutional network, which takes your image pixels and then fit it into a set of convolutional layers. However there are a couple of statistical problems:


DQN approximate a set of values that are very interrelated (DDQN
solves it)
DQN tend to be overoptimistic. It will over-appreciate being in this state although this only happened due to the statistical error (Double DQN solves it)


$$Q(s,a) = V(s) + A(s,a)$$

By decoupling the estimation, intuitively our DDQN can learn which states are (or are not) valuable without having to learn the effect of each action at each state (since it’s also calculating V(s)).

We’re able to calculate V(s). This is particularly useful for states where their actions do not affect the environment in a relevant way. In this case, it’s unnecessary to calculate the value of each action. For instance, moving right or left only matters if there is a risk of collision

As @emilyfy said self.target_model.set_weights(self.model.get_weights()) - the updating of the target model.