March 2020
Beginner to intermediate
342 pages
8h 38m
English
Let’s recap where we are and where we want to go. In the previous chapters, we built a binary classifier. Now we want to apply that program to MNIST.
As a first step, we need to reshape MNIST’s images and labels into an input for our program. Let’s see how to do that.
Our binary classifier program expects its input formatted as two matrices: a set of examples X, and a set of labels Y. Let’s start with the matrix of examples X.
X is supposed to have one line per example and one column per input variable, plus a bias column full of 1s. (Remember the bias column? We talked about it in Bye Bye, Bias.)
To fit MNIST’s images to this format, we can reshape each image to a single line of pixels, ...