Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def get_batches(arr_x, arr_y, batch_size):
# iterate through the arrays
prv = 0
for n in range(batch_size, arr_x.shape[0], batch_size):
x = arr_x[prv:n,:]
y = arr_y[prv:n,:]
prv = n
yield x, y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment