b87368e1e7fd832b505db9cc08015ac7af8f95de,VAE/main.py,,test,#Any#,115

Before Change


        test_loss += loss_function(recon_batch_data, batch_data, mu, logvar)

    test_loss = test_loss.data[0] / test_data.size(0)
    print("TEST SET RESULTS:" + " " * 20)
    print("Average loss: {:.4f}".format(test_loss))


for epoch in range(1, NUM_EPOCHS + 1):

After Change




def test(epoch):
    model.eval()
    test_loss = 0
    for batch in test_loader:
        batch = Variable(batch)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: b87368e1e7fd832b505db9cc08015ac7af8f95de
Time: 2016-12-23
Author: jvanamersfoort@twitter.com
File Name: VAE/main.py
Class Name:
Method Name: test


Project Name: tensorlayer/srgan
Commit Name: 87ad8f5eb43629954755893fcb2674e53f8dc982
Time: 2019-05-08
Author: dhsig552@163.com
File Name: main.py
Class Name:
Method Name: evaluate