Skip to Content
Python Deep Learning
book

Python Deep Learning

by Valentino Zocca, Gianmario Spacagna, Daniel Slater, Peter Roelants
April 2017
Intermediate to advanced
406 pages
10h 15m
English
Packt Publishing
Content preview from Python Deep Learning

A convolutional layer example with Keras for cifar10

We can now try to use the same network on the cifar10 dataset. In Chapter 3, Deep Learning Fundamentals, we were getting a low 50% accuracy on test data, and to test the new network we have just used for the mnist dataset, we need to just make a couple of small changes to our code: we need to load the cifar10 dataset (without doing any re-shaping, those lines will be deleted):

(X_train, Y_train), (X_test, Y_test) = cifar10.load_data()

And then change the input values for the first convolutional layer:

model.add(Convolution2D(32, (3, 3), input_shape=(32, 32, 3)))

Running this network for 5 epochs will give us around 60% accuracy (up from about 50%) and 66% accuracy after 10 epochs, but then the network ...

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

Python Deep Learning - Second Edition

Python Deep Learning - Second Edition

Ivan Vasilev, Daniel Slater, Gianmario Spacagna, Peter Roelants, Valentino Zocca
Python Deep Learning Projects

Python Deep Learning Projects

Matthew Lamons, Rahul Kumar, Abhishek Nagaraja

Publisher Resources

ISBN: 9781786464453Supplemental Content