minibatch_slices_iterator

tfsnippet.utils.minibatch_slices_iterator(length, batch_size, skip_incomplete=False)

Iterate through all the mini-batch slices.

Parameters:
  • length (int) – Total length of data in an epoch.
  • batch_size (int) – Size of each mini-batch.
  • skip_incomplete (bool) – If True, discard the final batch if it contains less than batch_size number of items. (default False)
Yields
slice: Slices of each mini-batch. The last mini-batch may contain
less indices than batch_size.