fc0f28ef337bb7b087fbba43fb085af27d34d846,torchsample/transforms/image_transforms.py,Contrast,__call__,#Contrast#,220

Before Change



    def __call__(self, x, y=None):
        channel_means = x.mean(1)
        for i in range(2,x.dim()):
            channel_means = channel_means.mean(i)
        channel_means = channel_means.expand_as(x)

        x = (x - channel_means) * self.var + channel_means
        if y is not None:

After Change


        x = th.clamp((x - channel_means) * self.value + channel_means,0,1)

        if y is not None:
            channel_means = y.mean(1).mean(2).expand_as(y)
            y = th.clamp((y - channel_means) * self.value + channel_means,0,1)       
            return x, y
        return x
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: ncullen93/torchsample
Commit Name: fc0f28ef337bb7b087fbba43fb085af27d34d846
Time: 2017-05-05
Author: ncullen.th@dartmouth.edu
File Name: torchsample/transforms/image_transforms.py
Class Name: Contrast
Method Name: __call__


Project Name: scikit-learn-contrib/DESlib
Commit Name: f0c15f219b0761b14329ddd416cda82fa4bae841
Time: 2018-03-28
Author: rafaelmenelau@gmail.com
File Name: deslib/dcs/mcb.py
Class Name: MCB
Method Name: estimate_competence


Project Name: scikit-learn-contrib/DESlib
Commit Name: 85d5c30d2186d07857d1f0fb7c269eb08d2b7d79
Time: 2018-04-07
Author: rafaelmenelau@gmail.com
File Name: deslib/des/des_clustering.py
Class Name: DESClustering
Method Name: fit