Querying Our Neural Network
Learn how to make predictions on unseen data.
We'll cover the following...
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 datamnist_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 recordrecord = 19# plot image and correct labelmnist_test_dataset.plot_image(record)
We can see the image looks like a 4. ...