Skip to Content
Python Deep Learning - Second Edition
book

Python Deep Learning - Second Edition

by Ivan Vasilev, Daniel Slater, Gianmario Spacagna, Peter Roelants, Valentino Zocca
January 2019
Intermediate to advanced
386 pages
11h 13m
English
Packt Publishing
Content preview from Python Deep Learning - Second Edition

A CNN example with Keras and CIFAR-10

In Chapter 3, Deep Learning Fundamentals, we tried to classify the CIFAR-10 images with a fully-connected network, but we only managed 51% test accuracy. Let's see if we can do better with all the new things we've learned. This time we'll use CNN with data augmentation.

  1. We'll start with the imports. We'll use all the layers we introduced in this chapter, as shown in the following example:
import kerasfrom keras.datasets import cifar10from keras.layers import Conv2D, MaxPooling2Dfrom keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalizationfrom keras.models import Sequentialfrom keras.preprocessing.image import ImageDataGenerator
  1. We'll define the mini batch_size for convenience, as ...
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

Python Deep Learning

Valentino Zocca, Gianmario Spacagna, Daniel Slater, Peter Roelants

Publisher Resources

ISBN: 9781789348460Supplemental Content