...

/

Querying Our Neural Network

Querying Our Neural Network

Learn how to make predictions on unseen data.

Now that we have a fairly well-trained network, let’s ask it to classify images. We’ll switch to the MNIST test dataset of 10,000 images. These are images our neural network has not yet seen.

Loading the test data

Let’s load the dataset with a new Dataset object.

Press + to interact
# load MNIST test data
mnist_test_dataset = MnistDataset('mnist_data/mnist_test.csv')

Classifying the test sample

We can pick a record from the test dataset and see what the image looks like. The following code picks the 20th record, which has index 19.

Press + to interact
# pick a record
record = 19
# plot image and correct label
mnist_test_dataset.plot_image(record)

We can see the image looks like a 4. ...