Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Keras Deep Learning Cookbook

You're reading from  Keras Deep Learning Cookbook

Product type Book
Published in Oct 2018
Publisher Packt
ISBN-13 9781788621755
Pages 252 pages
Edition 1st Edition
Languages
Authors (3):
Rajdeep Dua Rajdeep Dua
Profile icon Rajdeep Dua
Sujit Pal Sujit Pal
Profile icon Sujit Pal
Manpreet Singh Ghotra Manpreet Singh Ghotra
Profile icon Manpreet Singh Ghotra
View More author details
Toc

Table of Contents (17) Chapters close

Title Page
Copyright and Credits
Packt Upsell
Contributors
Preface
1. Keras Installation 2. Working with Keras Datasets and Models 3. Data Preprocessing, Optimization, and Visualization 4. Classification Using Different Keras Layers 5. Implementing Convolutional Neural Networks 6. Generative Adversarial Networks 7. Recurrent Neural Networks 8. Natural Language Processing Using Keras Models 9. Text Summarization Using Keras Models 10. Reinforcement Learning 1. Other Books You May Enjoy Index

CIFAR-10 dataset


Load the CIFAR-10 small images classification dataset from https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz. The CIFAR-10 dataset is made up of 60,000 32 x 32 color images in 10 classes, and there are 6000 images per class. The dataset consists of 50,000 training images and 10,000 test images.

 

The dataset has been divided into five training batches and one test batch, each with 10,000 images. The test batch contains 1,000 randomly selected images from each class. The training batches contain the rest of the images in a random order; some training batches may contain more images from one class than another. The training batches contain 5,000 images from each class, such as shown in the following image:

Reference: https://www.cs.toronto.edu/~kriz/cifar.html.

How to do it...

Let's load this dataset using the Keras APIs and print the shape and size:

from keras.datasets import cifar10

(X_train, y_train), (X_test, y_test) = cifar10.load_data()
print("X_train shape: " + str...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at ₹800/month. Cancel anytime