42418e10a68f534b939a125a9ccd60167f9a6633,torchsample/transforms/affine_transforms.py,Rotate,__call__,#Rotate#Any#Any#,252
Before Change
if self.lazy:
return rotation_matrix
else:
x_transformed = torch.from_numpy(apply_transform(x.numpy(), rotation_matrix,
fill_mode=self.fill_mode, fill_value=self.fill_value))
if y is not None:
y_transformed = torch.from_numpy(apply_transform(y.numpy(), rotation_matrix,
fill_mode=self.target_fill_mode, fill_value=self.target_fill_value))
return x_transformed, y_transformed
else:
return x_transformed
After Change
def __call__(self, x, y=None):
degree = random.uniform(-self.rotation_range, self.rotation_range)
theta = math.pi / 180 * degree
rotation_matrix = torch.FloatTensor([[math.cos(theta), -math.sin(theta), 0],
[math.sin(theta), math.cos(theta), 0],
[0, 0, 1]])
if self.lazy:
return rotation_matrix
else:
x_transformed = _apply_transform(x, rotation_matrix, self.coords)
if y is not None:
y_transformed = _apply_transform(y, rotation_matrix, self.coords)
return x_transformed, y_transformed
else:
return x_transformed
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 16
Instances
Project Name: ncullen93/torchsample
Commit Name: 42418e10a68f534b939a125a9ccd60167f9a6633
Time: 2017-04-18
Author: ncullen@modv-vlan533.0292.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Rotate
Method Name: __call__
Project Name: ncullen93/torchsample
Commit Name: 42418e10a68f534b939a125a9ccd60167f9a6633
Time: 2017-04-18
Author: ncullen@modv-vlan533.0292.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Rotate
Method Name: __call__
Project Name: ncullen93/torchsample
Commit Name: 42418e10a68f534b939a125a9ccd60167f9a6633
Time: 2017-04-18
Author: ncullen@modv-vlan533.0292.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Zoom
Method Name: __call__
Project Name: ncullen93/torchsample
Commit Name: 42418e10a68f534b939a125a9ccd60167f9a6633
Time: 2017-04-18
Author: ncullen@modv-vlan533.0292.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/transforms/affine_transforms.py
Class Name: Shear
Method Name: __call__