![]() |
VOOZH | about |
In machine learning, datasets are essential because they serve as benchmarks for comparing and assessing the performance of different algorithms. Fashion MNIST is one such dataset that replaces the standard MNIST dataset of handwritten digits with a more difficult format. The article explores the Fashion MNIST dataset, including its characteristics, uses, and how can we load it using PyTorch.
Fashion-MNIST is a dataset developed by Zalando Research as a modern alternative to the original MNIST dataset. It comprises 70,000 grayscale images categorized into 10 fashion-related items. Each image is 28x28 pixels, providing a uniform format for machine learning model input. The dataset is divided into a training set of 60,000 images and a test set of 10,000 images.
The ten categories in Fashion MNIST are:
Here are the key characteristics of the Fashion-MNIST dataset in bullet points:
The 'torchvision.datasets.FashionMNIST()' function is used to load the FashionMNIST dataset in PyTorch.
torchvision.datasets.FashionMNIST(root: Union[str, Path], train: bool = True, transform: Optional[Callable] = None, target_transform: Optional[Callable] = None, download: bool = False)
Breakdown of Parameters:
In the following code, we have loaded the Fashion MNIST dataset using PyTorch and displayed 4x4 grid of images with their labels.
For loading the Fashion MNIST dataset, we have followed these steps:
transforms.ToTensor() to convert the images into PyTorch tensors.torchvision.datasets.FashionMNIST(). It downloads the dataset if it's not already downloaded and applies the defined transformation.Output: