fc0f28ef337bb7b087fbba43fb085af27d34d846,torchsample/transforms/image_transforms.py,Contrast,__call__,#Contrast#Any#Any#,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


    def __call__(self, x, y=None):
        channel_means = x.mean(1).mean(2)
        channel_means = channel_means.expand_as(x)
        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: 3

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: Kaixhin/Rainbow
Commit Name: 22bd62194e97151e6354edd4d04a3c414083cc9c
Time: 2017-11-05
Author: design@kaixhin.com
File Name: model.py
Class Name: DQN
Method Name: forward


Project Name: rusty1s/pytorch_geometric
Commit Name: 45a03ac258234ba49c0a43d46ae022493190591e
Time: 2019-03-26
Author: matthias.fey@tu-dortmund.de
File Name: torch_geometric/nn/models/autoencoder.py
Class Name: ARGA
Method Name: reconstruction_loss