-
Notifications
You must be signed in to change notification settings - Fork 245
/
small.yml.j2
276 lines (269 loc) · 6.29 KB
/
small.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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
{% import "examples/configs/librispeech/wordpiece/wp_whitespace.yml.j2" as decoder_config with context %}
{{decoder_config}}
model_config:
class_name: tensorflow_asr.models.transducer.contextnet>ContextNet
config:
name: contextnet
speech_config:
sample_rate: 16000
frame_ms: 25
stride_ms: 10
num_feature_bins: 80
feature_type: log_mel_spectrogram
augmentation_config:
feature_augment:
time_masking:
prob: 1.0
num_masks: 10
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
encoder_alpha: 0.5
encoder_blocks:
# C0
- nlayers: 1
kernel_size: 5
filters: 256
strides: 1
residual: False
activation: silu
padding: causal
# C1-C2
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
# C3
- nlayers: 5
kernel_size: 5
filters: 256
strides: 2
residual: True
activation: silu
padding: causal
# C4-C6
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
# C7
- nlayers: 5
kernel_size: 5
filters: 256
strides: 2
residual: True
activation: silu
padding: causal
# C8 - C10
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 256
strides: 1
residual: True
activation: silu
padding: causal
# C11 - C13
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
# C14
- nlayers: 5
kernel_size: 5
filters: 512
strides: 2
residual: True
activation: silu
padding: causal
# C15 - C21
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
- nlayers: 5
kernel_size: 5
filters: 512
strides: 1
residual: True
activation: silu
padding: causal
# C22
- nlayers: 1
kernel_size: 5
filters: 640
strides: 1
residual: False
activation: silu
padding: causal
prediction_label_encode_mode: embedding
prediction_embed_dim: 640
prediction_num_rnns: 1
prediction_rnn_units: 512
prediction_rnn_type: lstm
prediction_rnn_implementation: 2
prediction_rnn_unroll: False
prediction_layer_norm: False
prediction_projection_units: 0
joint_dim: 512
prejoint_encoder_linear: True
prejoint_prediction_linear: True
postjoint_linear: False
joint_activation: tanh
joint_mode: add
blank: 0
vocab_size: {{decoder_config.vocabsize}}
kernel_regularizer:
class_name: l2
config:
l2: 1e-6
bias_regularizer:
class_name: l2
config:
l2: 1e-6
learning_config:
optimizer_config:
class_name: Custom>Adam
config:
learning_rate:
class_name: tensorflow_asr.optimizers.schedules>TransformerSchedule
config:
dmodel: 320
warmup_steps: 15000
max_lr: 0.0025
min_lr: 1e-6
scale: 2.0
beta_1: 0.9
beta_2: 0.98
epsilon: 1e-9
weight_decay: 1e-6
gwn_config:
predict_net_step: 20000
predict_net_stddev: 0.075
gradn_config: null
batch_size: 4
ga_steps: 8
num_epochs: 400
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: False
write_images: False
write_steps_per_second: False
update_freq: batch
profile_batch: 0