How it works...

This section explains the process used to access the MNIST datasets:

  1. Once we receive a confirmation that the TensorFlow library has been properly installed, it is imported into the notebook.
  2. We can confirm the version of TensorFlow as well as extract the images to our local folder of MNIST/The extraction process is visible in the output of the notebook, as seen in the following screenshot:
  1. The four extracted files are named the following:
    1. t10k-images-idx3-ubyte.gz
    2. t10k-labels-idx1-ubyte.gz
    3. train-images-idx3-ubyte.gz
    4. train-labels-idx1-ubyte.gz
  2. They have been downloaded to the MNIST/ subfolder as seen in the following screenshot:
  1. In addition, the four files can be viewed in our notebook, as seen in the following screenshot:
  1. The four files are the testing and training images along with the accompanying testing and training labels identifying each image in the testing and training datasets. Additionally, the one_hot = True feature is explicitly defined. This indicates that one-hot encoding is active with the labels, which assists with feature selection within modeling as each column value will be either 0 or 1.
  2. A subclass of the library is also imported that stores the handwritten images of MNIST to the specified local folder. The folder containing all of the images should be approximately 12 MB in size for 55,000 training images and 10,000 testing images, as seen in the following screenshot:
  1. The 10,000 images will be used to test the accuracy of our model that will be trained on the 55,000 images.