Skip to content

Instantly share code, notes, and snippets.

View pvt-16's full-sized avatar
:atom:
Focusing

Prabha Venkatesh pvt-16

:atom:
Focusing
  • 00:03 (UTC +01:00)
View GitHub Profile
@pvt-16
pvt-16 / test_dataset_use.py
Created June 17, 2019 13:35
Using the test data set for MNIST fashion example
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()