CIFAR10
Common entry points for obtaining CIFAR-10 datasets across platforms.
CIFAR-10 is a dataset of 60,000 32x32 color images in 10 classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, and truck. There are 50,000 training images and 10,000 test images.
The images are stored in channel-first format (3x32x32 = 3072 bytes per image).
Usage
// Load training data
val trainDataset = CIFAR10.loadTrain()
// Load test data
val testDataset = CIFAR10.loadTest()
// Iterate over batches
val batchIterator = trainDataset.batchIterator<Int8, Byte>(32)
for (batch in batchIterator) {
val images = batch.x[0] // Shape: [32, 3, 32, 32]
val labels = batch.y // Shape: [32]
}
// Get class name for a sample
val sample = trainDataset.getX(0)
println("Class: ${sample.className()}") // e.g., "airplane"Content copied to clipboard