Created
May 27, 2019 21:15
-
-
Save frogermcs/12cb89263587c832f910e3d562a800d2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get predictions for each image | |
predicted_ids = np.argmax(tf_model_predictions, axis=-1) | |
predicted_labels = dataset_labels[predicted_ids] | |
# Print images batch and labels predictions | |
plt.figure(figsize=(10,9)) | |
plt.subplots_adjust(hspace=0.5) | |
for n in range(30): | |
plt.subplot(6,5,n+1) | |
plt.imshow(val_image_batch[n]) | |
color = "green" if predicted_ids[n] == true_label_ids[n] else "red" | |
plt.title(predicted_labels[n].title(), color=color) | |
plt.axis('off') | |
_ = plt.suptitle("Model predictions (green: correct, red: incorrect)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment