O'Reilly logo

Apache Spark Deep Learning Cookbook by Amrith Ravindra, Ahmed Sherif

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

How it works...

This section explains how the convolutional neural network is built on Keras to identify handwritten images from MNIST.

  1. For any model development, we need to identify our testing and training datasets as well as the features and the labels. In our case, it is pretty straightforward as the MNIST data from TensorFlow is already broken up into data.train.images for the features and data.train.labels for the labels. Additionally, we want to convert the labels into arrays, so we utilize np.asarray() for ytest and ytrain.
  1. The arrays for xtrain, xtest, ytrain, and ytest are currently not in the proper shape to be used for a convolutional neural network within Keras. As we identified early on in the chapter, the features for the ...

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