Skip to content

Commit 210945c

Browse files
author
Ji Chen
committed
update input type
1 parent 4b54683 commit 210945c

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

examples/pipeline_wavernn/datasets.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@ def raw_collate(batch):
7373
x_input = waves[:, :seq_len]
7474
y_coarse = waves[:, 1:]
7575

76+
bits = 16 if args.mode == 'MOL' else args.n_bits
77+
78+
x_input = 2 * x_input / (2**bits - 1.) - 1
79+
80+
if args.mode == 'MOL':
81+
y_coarse = 2 * y_coarse.float() / (2**bits - 1.) - 1
82+
7683
return x_input, mels, y_coarse
7784

7885
return raw_collate

0 commit comments

Comments
 (0)