I have a tensorflow dataset and would like to batch it such that batches do not have the same size - something like examples being grouped in batches whose sizes are defined by a vector of values rather than a fixed value.
Is there a way to do it within tensorflow?
And for a network without fixed batch size, is feeding irregular batches going to be a problem?
Thanks in advance!
The answer is yes. model.fit() method allows to pass to it a generator which will generate randomly-sized batches.
Another, more elegant, way would be to subclass
tf.keras.utils.Sequence
and feed it to the model: