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

Before Change



    def __call__(self, x, y=None):
        x_gs = Grayscale(keep_channels=True)(x)
        x_gs.fill_(x_gs[1].mean())

        alpha = 1.0 + random.uniform(-self.var, self.var)
        x = _blend(x, x_gs, alpha)

After 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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 2

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: maciejkula/spotlight
Commit Name: 06a07d00d11fb103a079a9adb0de4c3865a7f69e
Time: 2017-08-19
Author: maciej.kula@gmail.com
File Name: spotlight/layers.py
Class Name: BloomEmbedding
Method Name: forward


Project Name: ikostrikov/pytorch-a2c-ppo-acktr
Commit Name: 4586366c1018257dd448d62f1fc7534e3f5a4338
Time: 2017-11-23
Author: ikostrikov@gmail.com
File Name: enjoy.py
Class Name:
Method Name: