April 2018
Beginner to intermediate
566 pages
12h 17m
English
In this section, we will be coding the Space Invaders game using DQN and Q-learning. For coding, we will be using the gym, TensorFlow, and virtualenv libraries. You can refer to the entire code by using this GitHub link: https://github.com/jalajthanaki/SpaceInvaders_gamingbot.
We are using a convolutional neural network (CNN). Here, we have defined the CNN in a separate file. The name of this file is convnet.py. Take a look at the following screenshot: at the following figure:

Figure 11.16: Code snippet for Convnrt.py
You can refer to the code using this GitHub link: https://github.com/jalajthanaki/SpaceInvaders_gamingbot/blob/master/convnet.py ...
Read now
Unlock full access