7b34113cc3b5529a127bd02667de9de0b5b75df9,models/networks_basic.py,PNet,forward,#PNet#Any#Any#Any#,40

Before Change


                all_scores+=[cur_score]

        if(retPerLayer):
            return (val, all_scores)
        else:
            return val

// Learned perceptual metric

After Change


        if(self.colorspace=="RGB"):
            value = util.dssim(1.*util.tensor2im(in0.data), 1.*util.tensor2im(in1.data), range=255.).astype("float")
        elif(self.colorspace=="Lab"):
            value = util.dssim(util.tensor2np(util.tensor2tensorlab(in0.data,to_norm=False)), 
                util.tensor2np(util.tensor2tensorlab(in1.data,to_norm=False)), range=100.).astype("float")
        ret_var = Variable( torch.Tensor((value,) ) )
        if(self.use_gpu):
            ret_var = ret_var.cuda()
        return ret_var
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 6

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/networks_basic.py
Class Name: PNet
Method Name: forward


Project Name: tensorflow/datasets
Commit Name: 3332773273242f370778ef157208442ec3167754
Time: 2019-10-18
Author: adarob@google.com
File Name: tensorflow_datasets/audio/nsynth.py
Class Name: Nsynth
Method Name: _info


Project Name: rusty1s/pytorch_geometric
Commit Name: 962544ef2a2890325a19f9433719fa7737d259ef
Time: 2017-10-20
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/modules/spline_gcn.py
Class Name: SplineGCN
Method Name: __init__


Project Name: rusty1s/pytorch_geometric
Commit Name: 075a7a98d0dd84aeee8eca0e199697d0f4729f3c
Time: 2019-11-22
Author: klicpera@in.tum.de
File Name: torch_geometric/transforms/gdc.py
Class Name: GDC
Method Name: _expm


Project Name: rlworkgroup/garage
Commit Name: 92c0e9198ac0aabe6bf5f5b924e601ae6d4d749e
Time: 2020-11-10
Author: 17186559+haydenshively@users.noreply.github.com
File Name: src/garage/torch/algos/vpg.py
Class Name: VPG
Method Name: _train_once


Project Name: rlworkgroup/garage
Commit Name: 92c0e9198ac0aabe6bf5f5b924e601ae6d4d749e
Time: 2020-11-10
Author: 17186559+haydenshively@users.noreply.github.com
File Name: src/garage/torch/algos/maml.py
Class Name: MAML
Method Name: _process_samples