The CIFAR datasets are benchmark classification datasets composed of 60,000 RGB thumbnail images of size 32x32 pixels. The CIFAR10 variant contains 10 classes while CIFAR100 provides 100 classes. Images are split into 50,000 training samples and 10,000 test samples.
Downloads and prepares the CIFAR100 dataset.
(string): Root directory of dataset where directory
cifar-10-batches-bin
exists or will be saved to if download is set to TRUE.
Logical. If TRUE, use the training set; otherwise, use the test set. Not applicable to all datasets.
Optional. A function that takes an image and returns a transformed version (e.g., normalization, cropping).
Optional. A function that transforms the label.
Logical. If TRUE, downloads the dataset to root/
. If the dataset is already present, download is skipped.
A torch::dataset object. Each item is a list with:
x
: a 32x32x3 integer array
y
: the class label
Downloads and prepares the CIFAR archives.
Other classification_dataset:
caltech_dataset
,
eurosat_dataset()
,
fer_dataset()
,
fgvc_aircraft_dataset()
,
flowers102_dataset()
,
mnist_dataset()
,
oxfordiiitpet_dataset()
,
tiny_imagenet_dataset()
if (FALSE) { # \dontrun{
ds <- cifar10_dataset(root = tempdir(), download = TRUE)
item <- ds[1]
item$x
item$y
} # }