CIFAR10 small images classification dataset

load_data function

keras.datasets.cifar10.load_data()

Loads the CIFAR10 dataset.

This is a dataset of 50,000 32×32 color training images and 10,000 test images, labeled over 10 categories. See more info at the CIFAR homepage.

The classes are:

LabelDescription
0airplane
1automobile
2bird
3cat
4deer
5dog
6frog
7horse
8ship
9truck

Returns

  • Tuple of NumPy arrays(x_train, y_train), (x_test, y_test).

x_trainuint8 NumPy array of grayscale image data with shapes (50000, 32, 32, 3), containing the training data. Pixel values range from 0 to 255.

y_trainuint8 NumPy array of labels (integers in range 0-9) with shape (50000, 1) for the training data.

x_testuint8 NumPy array of grayscale image data with shapes (10000, 32, 32, 3), containing the test data. Pixel values range from 0 to 255.

y_testuint8 NumPy array of labels (integers in range 0-9) with shape (10000, 1) for the test data.

Example

(x_train, y_train), (x_test, y_test) = keras.datasets.cifar10.load_data()
assert x_train.shape == (50000, 32, 32, 3)
assert x_test.shape == (10000, 32, 32, 3)
assert y_train.shape == (50000, 1)
assert y_test.shape == (10000, 1)

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *