given some data in a dataset (or tensor)
tensor = tf.constant([1, 2, 3, 4, 5, 6, 7])
i need to create N
batches of M
tuples by drawing (say 4 x 3
) with replacement. an example minibatch could be
[[1 2 3], [3, 4 5], [2, 3, 4], [5, 6, 7]]
The aim is to avoid creating a dataset in this form
[[1, 2, 3]
[2, 3, 4]
[4, 5, 6]
]
because of the massive redundancy. The batches should be created on the fly as I feed new mini-batches into the training process.