I manually built a data generator that yields a tuple of [input, target]
each call. I set my generator to shuffle the training samples every epoch. Then I use fit_generator
to call my generator
, but confuse at the "shuffle" argument in this function:
fit_generator(self, generator, steps_per_epoch=None, epochs=1, verbose=1, callbacks=None, validation_data=None, validation_steps=None, class_weight=None, max_queue_size=10, workers=1, use_multiprocessing=False, shuffle=True, initial_epoch=0)
From Keras API:
shuffle: Whether to shuffle the order of the batches at the beginning of each epoch. Only used with instances of Sequence (keras.utils.Sequence)
I thought "shuffle" should be the job of the generator
. How can it shuffle the order of the batches when my custom generator
decides which batch to be output in each iteration?