O'Reilly logo

Deep Learning By Example by Ahmed Menshawy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data analysis

So, let's go ahead and start implementing our classifier. Let's start off by importing the required packages for this implementation:

import tensorflow as tfimport matplotlib.pyplot as pltimport numpy as npimport random as ran

Next up, we are going to define some helper functions to make us able to subset from the original dataset that we have downloaded:

#Define some helper functions # to assign the size of training and test data we will take from MNIST datasetdef train_size(size):    print ('Total Training Images in Dataset = ' + str(mnist_dataset.train.images.shape))    print ('############################################')    input_values_train = mnist_dataset.train.images[:size,:] print ('input_values_train Samples Loaded = ' + ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required