Skip to content

Commit 488d56c

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 96af310 commit 488d56c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

computer_vision/mnist_classifier.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
This program is a MNIST classifier using AlexNet.
2+
This program is a MNIST classifier using AlexNet.
33
44
For example, to train and test AlexNet with 1 and 2 MNIST samples with 4 training epochs.
55
The command line input should be:
@@ -103,9 +103,9 @@ def test(model, test_loader):
103103
with torch.no_grad():
104104
data, target = Variable(data), Variable(target)
105105
output = model(data)
106-
test_loss += F.cross_entropy(output, target, reduction="sum").item()
106+
test_loss += F.cross_entropy(output, target, reduction="sum").item()
107107
# size_average=False
108-
pred = output.data.max(1, keepdim=True)[1]
108+
pred = output.data.max(1, keepdim=True)[1]
109109
# get the index of the max log-probability
110110
correct += pred.eq(target.data.view_as(pred)).long().cpu().sum()
111111

0 commit comments

Comments
 (0)