July 2019
Intermediate to advanced
512 pages
19h 39m
English
Now we will learn how to build a CNN using TensorFlow. We will use the MNIST handwritten digits dataset and understand how a CNN recognizes handwritten digits, and we will also visualize how the convolutional layers extract important features from the image.
First, let's load the required libraries:
import warningswarnings.filterwarnings('ignore')import numpy as npimport tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_datatf.logging.set_verbosity(tf.logging.ERROR)import matplotlib.pyplot as plt%matplotlib inline
Load the MNIST dataset:
mnist = input_data.read_data_sets('data/mnist', one_hot=True)
Read now
Unlock full access