O'Reilly logo

Learn Unity ML-Agents - Fundamentals of Unity Machine Learning by Micheal Lanham

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Building the deep network

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:

  1. Open Visual Studio Code, click File | New File, and create a new file named DeepQLearning.py.
  2. 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required