def compute_generator_steps(idx, sampling_step, batch_size):
    """Computes the number of steps for Keras.models.fit_generator.
    
    :param idx: int tuple - (start_row, end_row) : start and end rows; one of train_val_split() results
    :param sampling_step: int - step of the sliding time window.
    :param batch_size: int - batch size for mini-batch gradient descent.
    :return: int - number of samples yielded by the generator in one epoch 
    """
    nb_indices = idx[1] - idx[0]
    nb_indiv_samples = nb_indices // sampling_step + min(nb_indices %
        sampling_step, 1)
    nb_batches = nb_indiv_samples // batch_size + min(nb_indiv_samples %
        batch_size, 1)
    return nb_batches
