Skip to content

Instantly share code, notes, and snippets.

@bartubozkurt
Created August 29, 2021 15:24
Show Gist options
  • Save bartubozkurt/3b853c5f4009d0dffcd6489f7a9280c4 to your computer and use it in GitHub Desktop.
Save bartubozkurt/3b853c5f4009d0dffcd6489f7a9280c4 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