In this section, we'll build a deep Q-network using Keras and TensorFlow to solve the CartPole task.
As mentioned in the last chapter, many people incorrectly generalize the term deep Q-network to include any Q-learning implementation that uses a neural network. The main distinction between regular neural networks and deep learning is that deep learning structures contain many hierarchical neural network layers constructed into various architectures.
We discussed in the last chapter how to build a single-layer Q-network using TensorFlow at the level of individual layer architecture. Keras allows us to abstract much of the layer-level architecture control that TensorFlow provides. For this reason, we can treat the layer-level mathematical workings of the DQN as a black box at this point.
Refer to the previous chapter for a primer...