image_batch, label_batch = next(iter(validation_generator))
predicted_batch = model.predict_classes(image_batch)
plt.figure(figsize=(12,10))
for n in range(32):
plt.subplot(6,6,n+1)
plt.subplots_adjust(hspace = 0.3)
plt.imshow(image_batch[n])
color = "blue" if predicted_batch[n] == label_batch[n] else "red"
plt.title(predicted_batch[n], color=color)
plt.axis('off')
_ = plt.suptitle("Model predictions (blue: correct, red: incorrect)")