December 2018
Intermediate to advanced
268 pages
8h 23m
English
Let's walk through this code piece by piece to understand everything we to do in order to work with this data. As always, we start with boilerplate items for coding in Python. The first line establishes which Python interpreter we should use:
#!/usr/bin/env pythonimport numpy as npimport matplotlib.pyplot as pltfrom tensorflow.examples.tutorials.mnist import input_data
Next, we grab the data from the TensorFlow examples library:
# Read from this directorymnist = input_data.read_data_sets("MNIST_data/", one_hot=False)
There's an option for one-hot encoding in this import function. For this particular example, we will simply leave one-hot false.
Read now
Unlock full access