bfs18 / nsynth_wavenet

parallel wavenet based on nsynth
106 stars 30 forks source link

About the batch size #10

Closed HallidayReadyOne closed 6 years ago

HallidayReadyOne commented 6 years ago

Hi @bfs18 , thank you for the Great implement of pwavenet! I'm a little confused about batch size. In train_wavenet.py line 102: inputs_dict = wn.get_batch(clone_batch_size) which uses reader.Dataset.get_batch( ). However reader.Dataset.get_batch( ) seems to return a single sample. If I set gpu_id = 0,1,2,3, total_batch_size = 28, clone_batch_size should be 7? So reader.Dataset.get_batch( ) should uses BATCH_MELSPECTROGRAM instead of MELSPECTROGRAM?

bfs18 commented 6 years ago

--If I set gpu_id = 0,1,2,3, total_batch_size = 28, clone_batch_size should be 7? Yes. The difference between BATCH_MELSPECTROGRAM and MELSPECTROGRAM is that BATCH_MELSPECTROGRAM returns a numpy array and MELSPECTROGRAM returns a tensorflow tensor. They both return a batch of mel-spectrogram. You can check the reader output shape with tests/test_reader.py and refer to tf.train.shuffle_batch for more details.

HallidayReadyOne commented 6 years ago

@bfs18 Thank you for the reply. I will read the code again and check the reader output shape with test_reader.py