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...

The functionality is as follows:

  1. The crop() function executes the following tasks:
    1. Multiplies all pixels with an intensity of 28 with a numpy array of 1s and stores in variable a.
    2. Checks for all instances where an entire column consists of only pixel intensities of 28 and stores in variable b.
    3. Deletes all columns (or Y axes) where pixel intensities are 28 for the entire column.
    4. Plots the resulting image. 
    1. Transposes the image in order to perform the preceding set of operations on all the rows (or X axes) in a similar manner.
    1. Multiplies all pixels with an intensity of 28 with a numpy array of 1s and stores in variable d.
    2. Checks for all instances where an entire column consists of only pixel intensities of 28 and ...

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