7b34113cc3b5529a127bd02667de9de0b5b75df9,models/__init__.py,PerceptualLoss,forward,#PerceptualLoss#,25

Before Change


            pred = 2 * pred  - 1

        if(self.use_gpu):
            target = target.cuda()
            pred = pred.cuda()

        if(not self.spatial):
            return self.model.forward_pair(target, pred)
        else:
            return self.model.forward(target, pred)

After Change



        if(self.use_gpu):
            target = Variable(target.to(device=self.gpu_ids[0]), requires_grad=True)
            pred = Variable(pred.to(device=self.gpu_ids[0]), requires_grad=True)

        return self.model.forward(target, pred)

def normalize_tensor(in_feat,eps=1e-10):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: richzhang/PerceptualSimilarity
Commit Name: 7b34113cc3b5529a127bd02667de9de0b5b75df9
Time: 2019-07-26
Author: rich.zhang@eecs.berkeley.edu
File Name: models/__init__.py
Class Name: PerceptualLoss
Method Name: forward


Project Name: ncullen93/torchsample
Commit Name: f4ca9b361adb382423c753f7f864a5dd0e454964
Time: 2017-05-12
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/tensor_transforms.py
Class Name: ToVariable
Method Name: __call__


Project Name: vinhkhuc/PyTorch-Mini-Tutorials
Commit Name: 713df9556d874cf9ede91563fccb746b8c54c35f
Time: 2017-05-24
Author: knvinh@gmail.com
File Name: 6_lstm.py
Class Name:
Method Name: predict