Programming a neural network
The best way to learn something is to do it, so in this section, we will write a simple neural network that we'll then train to perform various tasks. This network will have a set number of layers—input, hidden, and output—but we will allow for a number of neurons to be set in each layer. We will write this code in Unity so that we can use it in Chapter 10, Mixing in Mixed Reality.
Note
Writing a neural network is an advanced example, which will require a discussion with math to properly explain. If you feel overwhelmed at any time, you can always open up the finished project and check the final results. Of course, if you have written a neural network earlier, then you may also want to skip this section.
For this example, we will create a new project from the source Unity template, so let's get started by opening Command Prompt:
- Create a new folder called
ARCore
off the root (C:\
on Windows) folder using the following commands:
mkdir ARCore cd ARCore
- This set of commands...