77a6ec73c53c5cc62a2ae451694537144afa5644,mnist/main.py,,test,#Any#,74

Before Change


        print("Testing model: {}/{}".format(i, test_data.size(0)), end="\r")
        batch_data.data[:] = test_data[i:i+TEST_BATCH_SIZE]
        batch_targets.data[:] = test_labels[i:i+TEST_BATCH_SIZE]
        test_loss += criterion(model(batch_data), batch_targets)

    test_loss = test_loss.data[0]
    test_loss /= (test_data.size(0) / TEST_BATCH_SIZE) // criterion averages over batch size
    print("TEST SET RESULTS:" + " " * 20)

After Change


    print("TEST SET RESULTS:" + " " * 20)
    print("Average loss: {:.4f}, Accuracy: {}/{} ({:.0f}%)".format(
        test_loss, correct, test_data.size(0),
        float(correct)/test_data.size(0)*100))

for epoch in range(1, NUM_EPOCHS+1):
    train(epoch)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 77a6ec73c53c5cc62a2ae451694537144afa5644
Time: 2016-09-14
Author: alerer@fb.com
File Name: mnist/main.py
Class Name:
Method Name: test


Project Name: mittagessen/kraken
Commit Name: ac1a7da11afb1a1dd76900d12a07ed4497759d3e
Time: 2018-08-02
Author: mittagessen@l.unchti.me
File Name: kraken/ketos.py
Class Name:
Method Name: train