You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Curious as to why you didn't use a generator for batch creation and then also capped the number of iterations per epoch to 10. I updated the code to this:
data=list(audio.cache.items()) # could shuffle here as wellsplit=int(len(data)*0.8)
train_data=data[:split]
valid_data=data[split:]
num_batches_per_epoch=len(train_data) //batch_sizetrain_gen=batch_generator(train_data, batch_size)
valid_gen=batch_generator(valid_data, batch_size)
#...training code....forbatch_numinrange(num_batches_per_epoch):
train_inputs, train_targets, train_seq_len, original=next(train_gen)
feed= {inputs: train_inputs,
targets: train_targets,
seq_len: train_seq_len,
keep_prob: 0.8}
This will be sure to cycle through the entire dataset while also shuffling it each cycle. It also allows the batch generator to be agnostic, which in my opinion is good. Just thought I would leave this here unsolicited.
Also, this is working just fine on tensorflow==1.9.0.
Thanks for building out this architecture!
The text was updated successfully, but these errors were encountered:
@mattc-eostar thanks a lot for this comment. If you could just work out a quick PR, it would be very useful. There's no reason on why I haven't used a generator. I just wanted to keep the code as simple as possible. But your code looks better!
Curious as to why you didn't use a generator for batch creation and then also capped the number of iterations per epoch to 10. I updated the code to this:
Then we can use it like this
This will be sure to cycle through the entire dataset while also shuffling it each cycle. It also allows the batch generator to be agnostic, which in my opinion is good. Just thought I would leave this here unsolicited.
Also, this is working just fine on tensorflow==1.9.0.
Thanks for building out this architecture!
The text was updated successfully, but these errors were encountered: