Created
July 28, 2021 18:28
-
-
Save Akash-Rawat/00f50488df0ce2248e5e636a06eccd56 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
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