7e786cbaa2af5a666a3957b11d9621ae9f34a883,test.py,,,#,16

Before Change


        target = Variable(ToTensor()(target))
        if torch.cuda.is_available():
            image = image.unsqueeze(0).cuda()
            target = target.unsqueeze(0).cuda()

        out = model(image)
        mse = ((target - out) ** 2).mean()
        psnr = 10 * log10(1 / mse.data.cpu().numpy())

After Change


        image = Image.open(data_path + image_name)
        image = Variable(ToTensor()(image)).unsqueeze(0)
        target = Image.open(target_path + image_name)
        target = Variable(ToTensor()(target)).unsqueeze(0)
        if torch.cuda.is_available():
            image.cuda()
            target.cuda()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 3

Instances


Project Name: leftthomas/SRGAN
Commit Name: 7e786cbaa2af5a666a3957b11d9621ae9f34a883
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:


Project Name: leftthomas/SRGAN
Commit Name: 1433d4c435a253e891009b08a9280bc452087db0
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:


Project Name: xinntao/BasicSR
Commit Name: 2b38855e22530bab3e66dda77c4fc653c141c1d1
Time: 2018-06-11
Author: wxt1994@126.com
File Name: codes/models/modules/sft_arch.py
Class Name:
Method Name:


Project Name: leftthomas/SRGAN
Commit Name: d6d411e49df0e130acf30d6ec21ce5c583c6a44e
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name:


Project Name: jadore801120/attention-is-all-you-need-pytorch
Commit Name: bed0a0ae26451c9897cf1ee0f7302e42eba9b42c
Time: 2018-08-23
Author: yhhuang@nlg.csie.ntu.edu.tw
File Name: transformer/Models.py
Class Name:
Method Name: get_attn_subsequent_mask