This repository has been archived by the owner on Aug 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathhparams.py
58 lines (51 loc) · 1.4 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
56
57
58
import tensorflow as tf
import numpy as np
hparams = tf.contrib.training.HParams(
#####################################
# Audio config
#####################################
sample_rate=22050,
silence_threshold=2,
num_mels=80,
fmin=125,
fmax=7600,
fft_size=1024,
win_length=1024,
hop_length=256,
min_level_db=-100,
ref_level_db=20,
rescaling=True,
rescaling_max=0.999,
audio_max_value=32767,
allow_clipping_in_normalization=True,
#####################################
# Data config
#####################################
seg_len= 81 * 256,
file_list="training_data/files.txt",
spec_len= 81,
#####################################
# Model parameters
#####################################
n_heads = 2,
pre_residuals = 4,
up_residuals=0,
post_residuals = 12,
pre_conv_channels = [1, 1, 2],
layer_channels = [1025 * 2, 1024, 512, 256, 128, 64, 32, 16, 8],
#####################################
# Training config
#####################################
n_workers=2,
seed=12345,
batch_size=40,
lr=1.0 * 1e-3,
weight_decay=1e-5,
epochs=50000,
grad_clip_thresh=5.0,
checkpoint_interval=1000,
)
def hparams_debug_string():
values = hparams.values()
hp = [' %s: %s' % (name, values[name]) for name in sorted(values)]
return 'Hyperparameters:\n' + '\n'.join(hp)