Created
June 17, 2019 13:35
-
-
Save pvt-16/14ccfedc662d8cefd29b19ec758d6e5d to your computer and use it in GitHub Desktop.
Using the test data set for MNIST fashion example
This file contains hidden or 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
| correct = 0 | |
| total = 0 | |
| for images, labels in testloader: | |
| # images = Variable(images.float()) | |
| flattened_images = images.view(images.shape[0],-1) | |
| outputs = model(flattened_images) | |
| _, predicted = torch.max(outputs.data, 1) | |
| total += labels.size(0) | |
| correct += (predicted == labels).sum() | |
| print('Test Accuracy of the model on the 10000 test images: %.4f %%' % (100 * correct / total)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment