Created
December 17, 2021 15:00
-
-
Save vinimonteiro/74019351d42fff6c99a6d29366287795 to your computer and use it in GitHub Desktop.
nn_pytorch_validation
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
orrect = 0 | |
total = 0 | |
with torch.no_grad(): | |
for data in testset: | |
data_input, target = data | |
output = model(data_input.view(-1, 784)) | |
for idx, i in enumerate(output): | |
if torch.argmax(i) == target[idx]: | |
correct += 1 | |
total += 1 | |
print('Accuracy: %d %%' % (100 * correct / total)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment