Exercise

Using CNNs to make predictions

Building and training neural networks is a very exciting job (trust me, I do it every day)! However, the main utility of neural networks is to make predictions. This is the entire reason why the field of deep learning has bloomed in the last few years, as neural networks predictions are extremely accurate. On this exercise, we are going to use the convolutional neural network you already trained in order to make predictions on the MNIST dataset.

Remember that torch.max() takes two arguments: -output.data - the tensor which contains the data.

  • Either 1 to do argmax or 0 to do max.

Instructions

100 XP
  • Iterate over the given test_loader, saving the results of each iteration in data.
  • Get the image and label from the data tuple, storing the results in image and label.
  • Make a forward pass in the net using your image.
  • Get the net prediction using torch.max() function.