An example of a deep convolutional network with Keras

In this example, we are going to implement a complete deep convolutional network using Keras and the original MNIST handwritten digits dataset (available through a Keras utility function). It is made up of 60,000 grayscale 28 × 28 images for training and 10,000 for testing the model. An example is shown in the following screenshot:

Samples extracted from the original MNIST dataset

The first step consists in loading and normalizing the dataset so that each sample contains values bounded between 0 and 1:

from keras.datasets import mnist(X_train, Y_train), (X_test, Y_test) = mnist.load_data() ...

Get Machine Learning Algorithms - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.