January 2018
Intermediate to advanced
310 pages
7h 48m
English
Load the MNIST data directly from TensorFlow. Note that we specify one hot encoding as an argument while loading the data. The label is stored as integers but should be loaded as one-hot encoding in-order to train. It is assumed that the reader is running the code from an editor with TensorFlow imported tf from this point onward. The following is the code snippet to load MNIST_data:
from tensorflow.examples.tutorials.mnist import input_datamnist_data = input_data.read_data_sets('MNIST_data', one_hot=True)
For the first run, the data will be downloaded and may take some time. From the second run, the cached data will be utilized. In the next section, we will build a perceptron to classify the digits.
Read now
Unlock full access