Skip to content

Instantly share code, notes, and snippets.

@satishgunjal
Created October 17, 2020 07:40
Show Gist options
  • Save satishgunjal/230206da034e987299c1e879656d378c to your computer and use it in GitHub Desktop.
Save satishgunjal/230206da034e987299c1e879656d378c to your computer and use it in GitHub Desktop.
Display the first 25 images from the training set and display the class name below each image.
# Display the first 25 images from the training set and display the class name below each image.
plt.figure(figsize=(10,10))
for i in range(25):
plt.subplot(5,5,i+1)
plt.xticks([])
plt.yticks([])
plt.grid(False)
plt.imshow(train_images[i], cmap=plt.cm.binary)
plt.xlabel(class_names[train_labels[i]])
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment