TensorFlow Deep Learning Projects
by Alexey Grigorev, Srinivas Kulkarni, Rajalingappaa Shanmugamani
Defining the AI brain
The first step in the project is to create a Brain class containing all the neural network code in order to compute a Q-value approximation. The class will contain the necessary initialization, the code for creating a suitable TensorFlow graph for the purpose, a simple neural network (not a complex deep learning architecture but a simple, working network for our project—you can replace it with more complex architectures), and finally, methods for fit and predict operations.
We start from initialization. As inputs, first, we really need to know the size of the state inputs (nS) corresponding to the information we receive from the game, and the size of the action output (nA) corresponding to the buttons we can press to ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access