Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion intermediate_source/char_rnn_classification_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ def train(rnn, training_data, n_epoch = 10, n_batch_size = 64, report_every = 50
# we cannot use dataloaders because each of our names is a different length
batches = list(range(len(training_data)))
random.shuffle(batches)
batches = np.array_split(batches, len(batches) //n_batch_size )
n_batches = (len(batches) + n_batch_size - 1) // n_batch_size
batches = np.array_split(batches, n_batches)

for idx, batch in enumerate(batches):
batch_loss = 0
Expand Down