Skip to content

Instantly share code, notes, and snippets.

@mjbhobe
Created August 15, 2018 19:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mjbhobe/cda626ca3941de7682bd1226f082ba4b to your computer and use it in GitHub Desktop.
Save mjbhobe/cda626ca3941de7682bd1226f082ba4b to your computer and use it in GitHub Desktop.
# let's pick 20 random values from the test data
rand_idx = np.random.randint(0, test_data.shape[0],20)
rand_images = test_data[rand_idx]
rand_labels_true = test_labels_cat[rand_idx]
# one-hot-decode the labels (reverse on-hot encoding)
y_true = np.argmax(rand_labels_true, axis=1)
print(y_true)
# predictions
y_pred = np.argmax(kr_base_model.predict(rand_images), axis=1)
print(y_pred)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment