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

Before Change


            target = target.cuda()
            pred = pred.cuda()

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


def cos_sim_blob(in0,in1):
    in0_norm = normalize_blob(in0)
    in1_norm = normalize_blob(in1)
    (N,C,X,Y) = in0_norm.shape

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: kevinzakka/recurrent-visual-attention
Commit Name: ec6113b96d65d4edb3da8aac88796bbd99fc9478
Time: 2018-01-22
Author: kevinarmandzakka@gmail.com
File Name: model.py
Class Name: RecurrentAttention
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__