title: How to choose batch_size, steps_per_epoch and epoch with Keras generator
body: <p>I'm training 2 different CNN (custom and transfer learning) for an image classification problem.
  I use the same generator for both models. 
  The dataset contains 5000 samples for 5 classes, but is imbalanced. </p>
  
  <p>Here's the custom model I'm using.</p>
  
  <pre><code>def __init__(self, transfer_learning = False, lambda_reg = 0.001, drop_out_rate = 0.1):
      if(transfer_learning == False):
          self.model = Sequential();
          self.model.add(Conv2D(32, (3,3), input_shape = (224,224,3), activation = "relu"))
          self.model.add(MaxPooling2D(pool_size = (2,2)))
  
          self.model.add(Conv2D(64, (1,1), activation = "relu"))
          self.model.add(MaxPooling2D(pool_size = (2,2)))
  
          self.model.add(Conv2D(128, (3,3), activation = "relu"))
          self.model.add(MaxPooling2D(pool_size = (2,2)))
  
          self.model.add(Conv2D(128, (1,1), activation = "relu"))
          self.model.add(MaxPooling2D(pool_size = (2,2)))
  
          self.model.add(Flatten())
  
          self.model.add(Dense(512))
          self.model.add(Dropout(drop_out_rate))
          self.model.add(Dense(256))
          self.model.add(Dropout(drop_out_rate))
  
          self.model.add(Dense(5, activation = "softmax"))
  </code></pre>
  
  <p>So I can't understand the relation between <code>steps_per_epoch</code> and <code>batch_size</code>.
  <code>batch_size</code> is the number of samples the generator sends. 
  But is <code>steps_per_epoch</code> the number of <code>batch_size</code> to complete one training epoch? 
  If so, then it should be: <code>steps_per_epoch = total_samples/batch_size</code> ? </p>
  
  <p>Whatever value I try, I always get the same problem (on both models), the <code>val_acc</code> seems to reach a local optima.  </p>