-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathhparams.py
55 lines (44 loc) · 1.37 KB
/
hparams.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# -*- coding: utf-8 -*-
import tensorflow as tf
import numpy as np
hparams = tf.contrib.training.HParams(
name="wavenet_vocoder",
NPY_DATAROOT="/mnt/lustre/sjtu/users/kc430/data/my/wavenet/cmu_arctic",
# Audio:
sample_rate=16000,
silence_threshold=2,
num_mels=80,
fft_size=1024,
# shift can be specified by either hop_size or frame_shift_ms
hop_size=256,
frame_shift_ms=None,
min_level_db=-100,
ref_level_db=20,
# global condition if False set global channel to None
gc_enable=True,
global_channel=16,
global_cardinality=7, # speaker num
filter_width=2,
# dilations=[1, 2, 4, 8, 16, 32, 64, 128,
# 1, 2, 4, 8, 16, 32, 64, 128],
dilations=[1, 2, 4, 8, 16, 32,
1, 2, 4, 8, 16, 32,
1, 2, 4, 8, 16, 32,
1, 2, 4, 8, 16, 32],
residual_channels=512,
dilation_channels=512,
quantization_channels=256,
skip_channels=256,
use_biases=True,
scalar_input=False,
initial_filter_width=32,
MOVING_AVERAGE_DECAY=0.9999,
upsample_conditional_features=True,
upsample_factor=[16, 16],
LEARNING_RATE_DECAY_FACTOR=0.5,
NUM_STEPS_RATIO_PER_DECAY=0.3,
)
def hparams_debug_string():
values = hparams.values()
hp = [' %s: %s' % (name, values[name]) for name in sorted(values)]
return 'Hyperparameters:\n' + '\n'.join(hp)