title: Does Keras flow_from_directory iterate through every sample in a directory?
body: <p>From the Keras Preprocessing ImageDataGenerator module, the flow_from_directory method is used to create an Iterator from a directory containing sub-directories of images.  The Iterator runs indefinitely creating batches of images.  My question is, does it iterate through every sample per epoch?  </p>
  
  <p>For example, if I have 300 image total, and my batch size is 30, if I do 10 steps, does it iterate through every single sample once?  Or is each step an independent random sample from the entire dataset?  If we do iterate through every sample, what happens when I have a sample size not divisible by batch size (like 304 images)?  At step 11, does the iterator know to get the last 4 samples first, then get another 26 samples from the whole dataset?</p>