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)
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

In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
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: utiasSTARS/liegroups
Commit Name: 071fb5fb20683946a33f40d28af466f8e9ffc1bd
Time: 2017-10-17
Author: clement.leopold@gmail.com
File Name: liegroups/torch/so2.py
Class Name: SO2
Method Name: left_jacobian
Project Name: abhiskk/fast-neural-style
Commit Name: e15bc113b83c2bdf980d2557971888d10011ef29
Time: 2017-03-14
Author: abhishekkadiyan@gmail.com
File Name: neuralstyle/transformernet.py
Class Name: InstanceNormalization
Method Name: forward