def mini_batches(X, Y, mini_batch_size=64, seed=0):
    m = X.shape[0]
    mini_batches = list()
    np.random.seed(seed)
    (shuffled_X, shuffled_Y) = (X, Y)
    num_complete_minibatches = int(math.floor((m / float(mini_batch_size))))
    for k in range(0, num_complete_minibatches):
        mini_batch_X = shuffled_X[(k * mini_batch_size):((k * mini_batch_size) + mini_batch_size), :]
        if (len(Y.shape) == 1):
            mini_batch_Y = shuffled_Y[(k * mini_batch_size):((k * mini_batch_size) + mini_batch_size)]
        else:
            mini_batch_Y = shuffled_Y[(k * mini_batch_size):((k * mini_batch_size) + mini_batch_size), :]
        mini_batch = (mini_batch_X, mini_batch_Y)
        mini_batches.append(mini_batch)
    if ((m % mini_batch_size) != 0):
        mini_batch_X = shuffled_X[(num_complete_minibatches * mini_batch_size):m, :]
        if (len(Y.shape) == 1):
            mini_batch_Y = shuffled_Y[(num_complete_minibatches * mini_batch_size):m]
        else:
            mini_batch_Y = shuffled_Y[(num_complete_minibatches * mini_batch_size):m, :]
        mini_batch = (mini_batch_X, mini_batch_Y)
        mini_batches.append(mini_batch)
    return mini_batches
def mini_batches(X, Y, mini_batch_size=64, seed=0):
    m = X.shape[0]
    mini_batches = list()
    np.random.seed(seed)
    (shuffled_X, shuffled_Y) = (X, Y)
    num_complete_minibatches = int(math.floor((m / float(mini_batch_size))))
    for k in range(0, num_complete_minibatches):
        mini_batch_X = shuffled_X[(k * mini_batch_size):((k * mini_batch_size) + mini_batch_size), :]
        if (len(Y.shape) == 1):
            mini_batch_Y = shuffled_Y[(k * mini_batch_size):((k * mini_batch_size) + mini_batch_size)]
        else:
            mini_batch_Y = shuffled_Y[(k * mini_batch_size):((k * mini_batch_size) + mini_batch_size), :]
        mini_batch = (mini_batch_X, mini_batch_Y)
        mini_batches.append(mini_batch)
    if ((m % mini_batch_size) != 0):
        mini_batch_X = shuffled_X[(num_complete_minibatches * mini_batch_size):m, :]
        if (len(Y.shape) == 1):
            mini_batch_Y = shuffled_Y[(num_complete_minibatches * mini_batch_size):m]
        else:
            mini_batch_Y = shuffled_Y[(num_complete_minibatches * mini_batch_size):m, :]
        mini_batch = (mini_batch_X, mini_batch_Y)
        mini_batches.append(mini_batch)
    return mini_batches