July 2019
Intermediate to advanced
512 pages
19h 39m
English
Load the dataset, using the following code:
mnist = input_data.read_data_sets("data/mnist", one_hot=True)
In the preceding code, data/mnist implies the location where we store the MNIST dataset, and one_hot=True implies that we are one-hot encoding the labels (0 to 9).
We will see what we have in our data by executing the following code:
print("No of images in training set {}".format(mnist.train.images.shape))print("No of labels in training set {}".format(mnist.train.labels.shape))print("No of images in test set {}".format(mnist.test.images.shape))print("No of labels in test set {}".format(mnist.test.labels.shape))No of images in training set (55000, 784) No of labels in training set (55000, 10) No of images in test set ...Read now
Unlock full access