Skip to content

Instantly share code, notes, and snippets.

@mohammedouahman
Created November 17, 2021 18:50
Show Gist options
  • Save mohammedouahman/e5027ef8f1ab4ca11a853ab3d739f0ad to your computer and use it in GitHub Desktop.
Save mohammedouahman/e5027ef8f1ab4ca11a853ab3d739f0ad to your computer and use it in GitHub Desktop.
# Plot the first X test images, their predicted labels, and the true labels.
# Color correct predictions in blue and incorrect predictions in red.
num_rows = 5
num_cols = 3
num_images = num_rows*num_cols
plt.figure(figsize=(2*2*num_cols, 2*num_rows))
for i in range(num_images):
plt.subplot(num_rows, 2*num_cols, 2*i+1)
plot_image(i, predictions[i], test_labels, test_images)
plt.subplot(num_rows, 2*num_cols, 2*i+2)
plot_value_array(i, predictions[i], test_labels)
plt.tight_layout()
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment