Skip to content

Instantly share code, notes, and snippets.

@Akash-Rawat
Created July 28, 2021 18:28
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 Akash-Rawat/00f50488df0ce2248e5e636a06eccd56 to your computer and use it in GitHub Desktop.
Save Akash-Rawat/00f50488df0ce2248e5e636a06eccd56 to your computer and use it in GitHub Desktop.
results = neuralnetwork_cnn.evaluate(test_images, verbose=0)
print(" Test Loss: {:.5f}".format(results[0]))
print("Test Accuracy: {:.2f}%".format(results[1] * 100))
Test Loss: 0.06885
Test Accuracy: 99.53%
# Predict the label of the test_images
pred = neuralnetwork_cnn.predict(test_images)
pred = np.argmax(pred,axis=1)
# Map the label
labels = (train_images.class_indices)
labels = dict((v,k) for k,v in labels.items())
pred = [labels[k] for k in pred]
# Display the result
print(f'The first 5 predictions: {pred[:5]}')
The first 5 predictions: ['horse racing', 'figure skating men', 'billiards', 'rugby', 'bmx']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment