-
Notifications
You must be signed in to change notification settings - Fork 130
/
demo-tf-rec-explicit-rnn.config
48 lines (39 loc) · 1.17 KB
/
demo-tf-rec-explicit-rnn.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
#!returnn/rnn.py
# kate: syntax python;
import os
from returnn.util.basic import get_login_username
demo_name, _ = os.path.splitext(__file__)
print("Hello, experiment: %s" % demo_name)
# task
use_tensorflow = True
task = "train"
# data
train = {"class": "Task12AXDataset", "num_seqs": 1000}
num_inputs = 9
num_outputs = 2
dev = train.copy()
dev.update({"num_seqs": train["num_seqs"] // 10, "fixed_random_seed": 42})
# network
# (also defined by num_inputs & num_outputs)
network = {
"rnn": {"class": "rec", "from": "data", "unit": {
"output": {"class": "linear", "activation": "tanh", "from": ["prev:output", "data:source"], "n_out": 20},
}},
"output": {"class": "softmax", "loss": "ce", "from": "rnn"}
}
debug_print_layer_output_template = True
# trainer
batching = "random"
batch_size = 5000
max_seqs = 40
chunking = "0"
optimizer = {"class": "adam"}
gradient_noise = 0.3
learning_rate = 0.0005
learning_rate_control = "newbob"
learning_rate_control_relative_error_relative_lr = True
model = "/tmp/%s/returnn/%s/model" % (get_login_username(), demo_name) # https://github.com/tensorflow/tensorflow/issues/6537
num_epochs = 100
save_interval = 20
# log
log_verbosity = 5