CIFAR10

Various functions for accessing the CIFAR10 dataset.

dynn.data.cifar10.download_cifar10(path='.', force=False)

Downloads CIFAR10 from “https://www.cs.toronto.edu/~kriz/cifar.html

Parameters:
  • path (str, optional) – Local folder (defaults to “.”)
  • force (bool, optional) – Force the redownload even if the files are already at path
dynn.data.cifar10.load_cifar10(path)

Loads the CIFAR10 dataset

Returns the train and test set, each as a list of images and a list of labels. The images are represented as numpy arrays and the labels as integers.

Parameters:path (str) – Path to the folder containing the *-ubyte.gz files
Returns:train and test sets
Return type:tuple
dynn.data.cifar10.read_cifar10(split, path)

Iterates over the CIFAR10 dataset

Example:

for image in read_cifar10("train", "/path/to/cifar10"):
    train(image)
Parameters:
  • split (str) – Either "training" or "test"
  • path (str) – Path to the folder containing the *-ubyte files
Returns:

image, label

Return type:

tuple