Vector shift (Roll) in Tensorflow
问题 Lets say, that we do want to process images (or ndim vectors) using Keras/TensorFlow. And we want, for fancy regularization, to shift each input by a random number of positions to the left (owerflown portions reappearing at the right side ). How could it be viewed and solved: 1) Is there any variation to numpy roll function for TensorFlow? 2) x - 2D tensor ri - random integer concatenate(x[:,ri:],x[:,0:ri], axis=1) #executed for each single input to the layer, ri being random again and again