def _generate_batches(self, x, y):
    'Creates a generator that iterates over the data in batches.'
    num_total = x.shape[0]
    for begin in range(0, num_total, BATCH_SIZE):
        end = min((begin + BATCH_SIZE), num_total)
        (yield (x[begin:end], y[begin:end]))
Creates a generator that iterates over the data in batches.
def _generate_batches(self, x, y):
    
    num_total = x.shape[0]
    for begin in range(0, num_total, BATCH_SIZE):
        end = min((begin + BATCH_SIZE), num_total)
        (yield (x[begin:end], y[begin:end]))