I wish to write a function in TensorFlow 2.0 than shuffles data and their target labels before each training iteration.
Let's say I have two numpy datasets, X and y, representing data and labels for classification. How can I shuffle them at the same time?
Using sklearn
it's pretty easy:
from sklearn.utils import shuffle
X, y = shuffle(X, y)
How can I do the same in TensorFlow 2.0 ? The only tool I found in the documentation is tf.random.shuffle, but it takes only one object at a time, I need to feed two.