Activity 3 - Displaying Clothing Samples

Workshop Resources

Display Samples

Now, you will be displaying all of your clothing samples by doing the following:

Copy the following code into your Colab notebook. This displays a collection of images along with their specific category.

plt.figure(figsize=(10,10)) #sets the image size to 10x10 inches
for i in range(25): #displays first 25 images with their class name
    plt.xlabel(class_names[train_labels[i]]) #shows images with their labels

Question 1

Your supervisor hands you out around 15-20 more clothing samples, which you will have to include in your program. Change the “for loop” so that there are 6 rows and 7 columns. How many images should you display?

Think about where you need to change the code to display this. The code currently displays 5 rows and 5 columns.