FashionMNIST

Common entry points for obtaining Fashion-MNIST datasets across platforms.

Fashion-MNIST is a dataset of Zalando's article images—consisting of a training set of 60,000 examples and a test set of 10,000 examples. Each example is a 28x28 grayscale image, associated with a label from 10 classes.

It serves as a direct drop-in replacement for the original MNIST dataset for benchmarking machine learning algorithms, as it shares the same image size and structure of training and testing splits.

Usage

// Load training data
val trainDataset = FashionMNIST.loadTrain()

// Load test data
val testDataset = FashionMNIST.loadTest()

// Iterate over batches
val batchIterator = trainDataset.batchIterator<Int8, Byte>(32)
for (batch in batchIterator) {
val images = batch.x[0] // Shape: [32, 1, 28, 28]
val labels = batch.y // Shape: [32]
}

Functions

Link copied to clipboard
fun loader(config: FashionMNISTLoaderConfig = FashionMNISTLoaderConfig()): FashionMNISTLoader

Create a platform-specific FashionMNISTLoader using the provided config.

Link copied to clipboard
suspend fun loadTest(config: FashionMNISTLoaderConfig = FashionMNISTLoaderConfig()): FashionMNISTDataset

Download (with caching if supported) and return the Fashion-MNIST test dataset.

Link copied to clipboard
suspend fun loadTrain(config: FashionMNISTLoaderConfig = FashionMNISTLoaderConfig()): FashionMNISTDataset

Download (with caching if supported) and return the Fashion-MNIST training dataset.