-
Notifications
You must be signed in to change notification settings - Fork 7
/
hyperparams.py
executable file
·31 lines (27 loc) · 1007 Bytes
/
hyperparams.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
class Hyperparams:
"""Hyperparameters"""
# data
source_train = "corpora/cn.txt"
target_train = "corpora/en.txt"
source_test = "corpora/cn.test.txt"
target_test = "corpora/en.test.txt"
# training
batch_size = 48 # alias = N
batch_size_valid = 32
lr = (
0.0001 # learning rate. In paper, learning rate is adjusted to the global step.
)
logdir = "logdir" # log directory
model_dir = "./models/" # saving directory
# model
maxlen = 50 # Maximum number of words in a sentence. alias = T.
min_cnt = 0 # words whose occurred less than min_cnt are encoded as <UNK>.
hidden_units = 512 # alias = C
num_blocks = 12 # number of encoder/decoder blocks
num_epochs = 50
num_heads = 8
dropout_rate = 0.4
sinusoid = False # If True, use sinusoid. If false, positional embedding.
eval_epoch = 1 # epoch of model for eval
eval_script = 'scripts/validate.sh'
check_frequency = 10 # checkpoint frequency