fea94d9805d3be49f5ae55d0ab3f35f07a5c6d12,train.py,,,#,19

Before Change


        lr = Variable(val_data)
        if torch.cuda.is_available():
            lr = lr.cuda()
        sr = netG(lr).data.cpu()
        utils.save_image(sr, out_path + "SR_epoch_%d_batch_%d.png" % (epoch, index), nrow=4)
        batch_mse = ((sr - val_target) ** 2).mean()
        valing_mse += batch_mse * batch_size
        valing_psnr = 10 * log10(1 / (valing_mse / valing_batch_sizes))

After Change


        if epoch == 1:
            utils.save_image(val_target, out_path + "HR_batch_%d.png" % index, nrow=4)
        lr = Variable(val_data)
        hr = Variable(val_target)
        if torch.cuda.is_available():
            lr = lr.cuda()
            hr = hr.cuda()
        sr = netG(lr)
        utils.save_image(sr.data, out_path + "SR_epoch_%d_batch_%d.png" % (epoch, index), nrow=4)

        batch_mse = ((sr - hr) ** 2).mean()
        valing_mse += batch_mse * batch_size
        batch_ssim = pytorch_ssim.ssim(sr, hr)
        valing_ssims += batch_ssim * batch_size
        valing_psnr = 10 * log10(1 / (valing_mse / valing_batch_sizes))
        valing_ssim = valing_ssims / valing_batch_sizes
        val_bar.set_description(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: leftthomas/SRGAN
Commit Name: fea94d9805d3be49f5ae55d0ab3f35f07a5c6d12
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: train.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: leftthomas/SRGAN
Commit Name: fea94d9805d3be49f5ae55d0ab3f35f07a5c6d12
Time: 2017-11-21
Author: leftthomas@qq.com
File Name: test.py
Class Name:
Method Name: