32c7386aef93737926069ee284d827f8e954e086,vae/main.py,,test,#Any#,122

Before Change


        recon_batch, mu, logvar = model(batch)
        test_loss += loss_function(recon_batch, batch, mu, logvar)

    test_loss = test_loss.data[0] / test_data.size(0)
    print("====> Test set results: {:.4f}".format(test_loss))


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

After Change


    for data, _ in test_loader:
        data = Variable(data, volatile=True)
        recon_batch, mu, logvar = model(data)
        test_loss += loss_function(recon_batch, data, mu, logvar).data[0]

    test_loss /= len(test_loader.dataset)
    print("====> Test set loss: {:.4f}".format(test_loss))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: OpenNMT/OpenNMT-py
Commit Name: 32c7386aef93737926069ee284d827f8e954e086
Time: 2017-01-17
Author: adam.paszke@gmail.com
File Name: vae/main.py
Class Name:
Method Name: test


Project Name: OpenNMT/OpenNMT-py
Commit Name: 32c7386aef93737926069ee284d827f8e954e086
Time: 2017-01-17
Author: adam.paszke@gmail.com
File Name: vae/main.py
Class Name:
Method Name: train


Project Name: maciejkula/spotlight
Commit Name: bed4f2dd50ff54eb7629362c3d03a3b758e0745a
Time: 2017-08-09
Author: maciej.kula@gmail.com
File Name: spotlight/layers.py
Class Name: BloomEmbedding
Method Name: forward