forked from LetianY/ancient-chinese-machine-translation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hyperparameters.py
47 lines (41 loc) · 1.76 KB
/
hyperparameters.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
class Hyperparams:
"""
Hyperparameters
data files:
m_e for english translation task (Pre-qin + ZiZhiTongJian)
c_m for mandarin translation task (24 History)
"""
# data file
source_data_m_e = "data/train_Pre-Qin+ZiZhiTongJian_m_utf8.txt"
target_data_m_e = "data/train_Pre-Qin+ZiZhiTongJian_e_utf8.txt"
source_data_c_m = "data/train_24-histories_c_utf8.txt"
target_data_c_m = "data/train_24_histories_m_utf8.txt"
# splitted data file
source_train_m_e = "data_splited/pre_qin_train_m.txt"
target_train_m_e = "data_splited/pre_qin_train_e.txt"
source_test_m_e = "data_splited/pre_qin_test_m.txt"
target_test_m_e = "data_splited/pre_qin_test_e.txt"
source_train_c_m = "data_splited/24_history_train_c.txt"
target_train_c_m = "data_splited/24_history_train_m.txt"
source_test_c_m = "data_splited/24_history_test_c.txt"
target_test_c_m = "data_splited/24_history_test_m.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