Could someone please tell me if ImageDataGenerator takes a random batch of original data while training, or does it take sequentially in every epoch, like the first 100 samples in the first iteration, the second 100 samples in the second iteration, and so on? I need to understand this as I’m training a convolutional autoencoder, and the input is passed as output too, in model.fit(). So both should correspond correctly.
The dataset has 3200 images of size 360x640. As of now, I have this:
gen = ImageDataGenerator()
train_im = ImageDataGenerator(
rescale=1./255,
shear_range=0.2,
horizontal_flip=False)
def train_images():
train_generator = train_im.flow_from_directory (
'train_frames',
target_size=(360, 640),
color_mode='rgb',
batch_size=100,
shuffle = True,
class_mode='categorical')
x = train_generator
return x[0][0], x[0][1]