
Again, each image is represented as 28 x 28 pixels: test_images.shapeĪnd the test set contains 10,000 images labels: len(test_labels) Likewise, there are 60,000 labels in the training set: len(train_labels)Įach label is an integer between 0 and 9: train_labelsĪrray(, dtype=uint8) The following shows there are 60,000 images in the training set, with each image represented as 28 x 28 pixels: train_images.shape Let's explore the format of the dataset before training the model. 'Sandal', 'Shirt', 'Sneaker', 'Bag', 'Ankle boot'] Since the class names are not included with the dataset, store them here to use later when plotting the images: class_names = ['T-shirt/top', 'Trouser', 'Pullover', 'Dress', 'Coat', These correspond to the class of clothing the image represents: LabelĮach image is mapped to a single label. The labels are an array of integers, ranging from 0 to 9. The images are 28x28 NumPy arrays, with pixel values ranging from 0 to 255.

They're good starting points to test and debug code. Both datasets are relatively small and are used to verify that an algorithm works as expected. This guide uses Fashion MNIST for variety, and because it's a slightly more challenging problem than regular MNIST. The MNIST dataset contains images of handwritten digits (0, 1, 2, etc.) in a format identical to that of the articles of clothing you'll use here. Fashion-MNIST samples (by Zalando, MIT License).įashion MNIST is intended as a drop-in replacement for the classic MNIST dataset-often used as the "Hello, World" of machine learning programs for computer vision. The images show individual articles of clothing at low resolution (28 by 28 pixels), as seen here:įigure 1.


This guide uses the Fashion MNIST dataset which contains 70,000 grayscale images in 10 categories. This guide uses tf.keras, a high-level API to build and train models in TensorFlow. It's okay if you don't understand all the details this is a fast-paced overview of a complete TensorFlow program with the details explained as you go. This guide trains a neural network model to classify images of clothing, like sneakers and shirts.
