1cb6edf4c090461a7e43bfd1b866aaba4b02cabe,vis/modifiers.py,Jitter,pre,#Jitter#Any#,88
Before Change
def pre(self, img):
self.jx, self.jy = np.random.randint(-self.jitter, self.jitter+1, 2)
return np.roll(np.roll(img, self.jx, self.row_idx), self.jy, self.col_idx)
def post(self, img):
// Un-shift the jitter.
return np.roll(np.roll(img, -self.jx, self.row_idx), -self.jy, self.col_idx)
After Change
def pre(self, img):
image_dims = len(img.shape) - 2
dim_offsets = np.random.randint(-self.jitter, self.jitter+1, image_dims).tolist()
if K.image_data_format() == "channels_first":
shift_vector = np.array([0, 0] + dim_offsets)
else:
shift_vector = np.array([0] + dim_offsets + [0])
return shift(img, shift_vector, mode="wrap", order=0)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: raghakot/keras-vis
Commit Name: 1cb6edf4c090461a7e43bfd1b866aaba4b02cabe
Time: 2017-05-07
Author: ragha@outlook.com
File Name: vis/modifiers.py
Class Name: Jitter
Method Name: pre
Project Name: tensorlayer/tensorlayer
Commit Name: d3bdc5449964423387861c78edd9d890a81a5466
Time: 2019-03-31
Author: jingqing.zhang15@imperial.ac.uk
File Name: tensorlayer/layers/core.py
Class Name:
Method Name: tolist
Project Name: tensorlayer/tensorlayer
Commit Name: aca1113c020ae5a220d2a075396ecb8a4a873ca6
Time: 2019-03-18
Author: rundi_wu@pku.edu.cn
File Name: tensorlayer/layers/core.py
Class Name: LayerNode
Method Name: __call__