Normally, after introducing neural networks, we would start with a simple example of perhaps a single neuron or layer. However, that type of sample would be less than impressive, and is small fry compared to building a working deep Q-learning example. This means that in order to build a working example, we need to jump into the deep end, pun intended. Go through the following exercise to build the example:
- Open Visual Studio Code, click File | New File, and create a new file named DeepQLearning.py.
- This first part of the code imports the various libraries we need, enter the following code
import numpy as np import gym from keras.models import Sequential from keras.layers import Dense, Activation, Flatten from ...