Chapter 10
Building the Network

In the previous chapter, we made a plan for building a neural network that classifies MNIST images. We started by concatenating two perceptrons, and we jotted down the number of rows and columns for all the matrices involved. The result was this diagram:

images/designing/network_plan.png

Keep the sketch handy, because we’re about to convert it to code. That job will take two chapters. In this one, we’ll write the neural network’s classification functions—in other words, all the code in the network, except for the training code. In the next chapter, we’ll complete the network and unleash it on an unsuspecting MNIST dataset.

Let’s get started with the classification functions. For reference, let’s start from the functions we already wrote in Part I, to implement the perceptron.