Deep Q networks (DQNs) are neural networks that approximate the Q function. They map states to actions and they learn to estimate the Q value of each action, as shown in the following figure:
Instead of trying to store a matrix that's infinitely large, mapping the rewards from continuous state spaces to actions, we can use a deep neural network as a function to approximate that matrix. In this way, we can use a neural network as the brain of an intelligent agent. But this all leads us to a very interesting question. How do we train this network?