Created
July 28, 2020 07:12
-
-
Save prateekjoshi565/9572566327dc93fc91e4b311d48e5392 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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