We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8c1f9b commit ae394aaCopy full SHA for ae394aa
1 file changed
train_mnist.py
@@ -126,8 +126,8 @@ def forward(self, x):
126
inputs, labels = inputs.to(device), labels.to(device)
127
outputs = model(inputs)
128
test_loss += criterion(outputs, labels).item()
129
- batch_correct = (outputs.argmax(1) == labels).sum().item()
130
- correct += batch_correct
+ batch_correct = (outputs.argmax(1) == labels).sum().item()
+ correct += batch_correct
131
batch_acc = batch_correct / len(inputs)
132
test_accuracies.append(batch_acc)
133
0 commit comments