364cd40384ad4f9cda4df949d0b1bd63abdcf6df,torchsample/transforms/image_transforms.py,Contrast,__call__,#Contrast#,216

Before Change


        x = _blend(x, x_gs, alpha)

        if y is not None:
            y_gs = Grayscale(keep_channels=True)(y)
            y_gs.fill_(y_gs[1].mean())
            y = _blend(y, y_gs, alpha)
            return x, y
        return x


After Change



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


class Gamma(object):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


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


Project Name: richzhang/colorization-pytorch
Commit Name: 9ba91fa13cbb1e7bc4069e46469b34abb5ca4869
Time: 2018-05-22
Author: tongzhou.wang.1994@gmail.com
File Name: models/networks.py
Class Name: GANLoss
Method Name: get_target_tensor