-
Notifications
You must be signed in to change notification settings - Fork 130
/
demo-tf-neural-transducer.12ax.config
54 lines (43 loc) · 1.75 KB
/
demo-tf-neural-transducer.12ax.config
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
#!returnn.py
# kate: syntax python;
use_tensorflow = True
import os
from returnn.util.basic import get_login_username
demo_name, _ = os.path.splitext(__file__)
print ("Hello, experiment: %s" % demo_name)
task = "train"
train = {"class": "Task12AXDataset", "num_seqs": 1000}
dev = {"class": "Task12AXDataset", "num_seqs": 100, "fixed_random_seed": 1}
num_inputs = 9
num_outputs = 2
batching = "random"
batch_size = 5000
max_seqs = 5
chunking = "200:200"
network = {
"fw_0" : { "class" : "rec", "unit": "NativeLSTM", "n_out" : 20, "dropout": 0.0, "L2": 0.01, "direction" : 1 },
"bw_0" : { "class" : "rec", "unit": "NativeLSTM", "n_out" : 20, "dropout": 0.0, "L2": 0.01, "direction" : -1 },
"fw_1" : { "class" : "rec", "unit": "NativeLSTM", "n_out" : 20, "dropout": 0.0, "L2": 0.01, "direction" : 1, "from": ["fw_0", "bw_0"] },
"bw_1" : { "class" : "rec", "unit": "NativeLSTM", "n_out" : 20, "dropout": 0.0, "L2": 0.01, "direction" : -1, "from": ["fw_0", "bw_0"] },
"output": {"class": "neural_transducer", "loss": "neural_transducer", "from": ["fw_1", "bw_1"], "transducer_hidden_units": 40,
"n_out": 3, "transducer_max_width": 6, "input_block_size": 5, "embedding_size": 20, "e_symbol_index": 2,
"use_prev_state_as_start":True,
"loss_opts":{
"debug":False, "max_variance": 99995
}
}
}
# training
gradient_nan_inf_filter = True
optimizer = {"class": "adam"}
gradient_clip = 10
gradient_noise = 0.3
learning_rate = 0.0005
learning_rate_control = "newbob"
learning_rate_control_relative_error_relative_lr = True
truncation = -1
model = "/tmp/%s/returnn/%s/model" % (get_login_username(), demo_name) # https://github.com/tensorflow/tensorflow/issues/6537
num_epochs = 100
save_interval = 1
# log
log_verbosity = 5