chrisdonahue / wavegan

WaveGAN: Learn to synthesize raw audio with generative adversarial networks
MIT License
1.32k stars 283 forks source link

Batch training #45

Closed toriving closed 5 years ago

toriving commented 5 years ago

HI, @chrisdonahue

I am trying to apply my sound file on Wavegan, your code. However, I don't know this code has a batch training block. In train_wavegan.py, I can find ' x = loader.decode_extract_and_batch(...)' It is return dataset iterator and, x is called only once. In my opinion, this means that batch size represents the total number of training data sets. I expected the same code below, but could not find it.

dataset = tf.data.Dataset(...)
dataset = dataset.batch(batch_size)
iterator = dataset.make_one_shot_iterator()

x = iterator.get_next()

while True:
    try:
        print(sess.run(x), end=' ')  
    except tf.errors.OutOfRangeError: 
        print('end\n')
        break

Thanks.

chrisdonahue commented 5 years ago

Sorry, I am not sure I understand your question. The loader is only called once because it creates a tensorflow Graph which streams training examples from disc every time the iterator tensors are used. Does this answer your question?

toriving commented 5 years ago

Sorry, I am not sure I understand your question. The loader is only called once because it creates a tensorflow Graph which streams training examples from disc every time the iterator tensors are used. Does this answer your question?

Oh, I understand it. Thanks.