Skip to Main Content
Apache Spark Deep Learning Cookbook
book

Apache Spark Deep Learning Cookbook

by Ahmed Sherif, Amrith Ravindra, Michal Malohlava, Adnan Masood
July 2018
Intermediate to advanced content levelIntermediate to advanced
474 pages
13h 37m
English
Packt Publishing
Content preview from Apache Spark Deep Learning Cookbook

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Apache Spark for Data Science Cookbook

Apache Spark for Data Science Cookbook

Padma Priya Chitturi
Learning Apache Spark 2

Learning Apache Spark 2

Muhammad Asif Abbasi

Publisher Resources

ISBN: 9781788474221Supplemental Content