-
Notifications
You must be signed in to change notification settings - Fork 245
/
Copy pathbase.yml.j2
108 lines (101 loc) · 2.73 KB
/
base.yml.j2
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
{% import "examples/configs/librispeech/characters/char.yml.j2" as decoder_config with context %}
{{decoder_config}}
model_config:
class_name: tensorflow_asr.models.ctc.deepspeech2>DeepSpeech2
config:
name: deepspeech2
speech_config:
sample_rate: 16000
frame_ms: 25
stride_ms: 10
nfft: 512
num_feature_bins: 80
feature_type: log_mel_spectrogram
augmentation_config:
feature_augment:
time_masking:
prob: 1.0
num_masks: 5
mask_factor: -1 # whole utterance
p_upperbound: 0.05
mask_value: 0
freq_masking:
prob: 1.0
num_masks: 1
mask_factor: 27
mask_value: 0
conv_type: conv2d
conv_kernels: [ [ 11, 41 ], [ 11, 21 ] ]
conv_strides: [ [ 2, 2 ], [ 1, 2 ] ]
conv_filters: [ 32, 32 ]
conv_activation: relu
conv_dropout: 0.2
conv_padding: same
conv_initializer: he_uniform
rnn_nlayers: 5
rnn_type: lstm
rnn_units: 512
rnn_bidirectional: True
rnn_unroll: False
rnn_rowconv: 0
rnn_rowconv_activation: relu
rnn_dropout: 0.3
rnn_initializer: glorot_uniform
fc_nlayers: 1
fc_units: 1024
fc_activation: relu
fc_dropout: 0.3
fc_initializer: he_uniform
blank: 0
vocab_size: {{decoder_config.vocabsize}}
kernel_regularizer:
class_name: l2
config:
l2: 0.0005
bias_regularizer:
class_name: l2
config:
l2: 0.0005
initializer: glorot_uniform
learning_config:
optimizer_config:
class_name: Custom>SGD
config:
learning_rate:
class_name: PolynomialDecay
config:
initial_learning_rate: 0.001
decay_steps: 10000 # around 5 epochs with batch size 16 and 8 tpus
end_learning_rate: 0.0001
power: 0.5
cycle: False
momentum: 0.9
nesterov: True
gwn_config: null
gradn_config: null
batch_size: 16
ga_steps: 4
num_epochs: 450
callbacks:
- class_name: tensorflow_asr.callbacks>TerminateOnNaN
config: {}
- class_name: tensorflow_asr.callbacks>ModelCheckpoint
config:
filepath: {{modeldir}}/checkpoints/{epoch:02d}.h5
save_best_only: False
save_weights_only: True
save_freq: epoch
- class_name: tensorflow_asr.callbacks>BackupAndRestore
config:
backup_dir: {{modeldir}}/states
save_freq: epoch
delete_checkpoint: False
- class_name: tensorflow_asr.callbacks>TensorBoard
config:
log_dir: {{modeldir}}/tensorboard
histogram_freq: 0
write_graph: True
write_images: False
write_steps_per_second: True
update_freq: batch
profile_batch: 0