-
Notifications
You must be signed in to change notification settings - Fork 0
/
hyperparams.py
124 lines (88 loc) · 3.54 KB
/
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
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
# -*- coding: utf-8 -*-
#/usr/bin/python3
class rc_Hyperparams:
trainset = './datasets/train_round_0.csv'
testset = './datasets/test_data_r0.csv'
trainfile = './preprocessed/train.csv'
testfile = './preprocessed/test.csv'
batch_size = 64 # alias = N
lr = 0.0001 # learning rate. In paper, learning rate is adjusted to the global step.
logdir = 'rc_model_dir' # log directory
# model
q_maxlen = 50
p_maxlen = 200
ans_maxlen = 40
min_cnt = 3 # words whose occurred less than min_cnt are encoded as <UNK>.
hidden_units = 256 # alias = C
num_blocks = 5 # number of encoder/decoder blocks
num_epochs = 20
num_heads = 8
dropout_rate = 0.5
sinusoid = False # If True, use sinusoid. If false, positional embedding.
dropout_keep_prob = 0.55
reg_lambda = 0.1
use_dropout = True
weight_decay = 0.1
class seq2seq_Hyperparams:
'''Hyperparameters'''
# data
source_train = './datasets/zh-en/train.tags.zh-en.en'
target_train = './datasets/zh-en/train.tags.zh-en.zh'
source_test = './datasets/zh-en/IWSLT15.TED.tst2011.zh-en.en.xml'
target_test = './datasets/zh-en/IWSLT15.TED.tst2011.zh-en.zh.xml'
# training
batch_size = 32 # alias = N
lr = 0.0001 # learning rate. In paper, learning rate is adjusted to the global step.
logdir = 'seq2seq_model_dir' # log directory
# model
maxlen = 100 # Maximum number of words in a sentence. alias = T.
# Feel free to increase this if you are ambitious.
min_cnt = 3 # words whose occurred less than min_cnt are encoded as <UNK>.
hidden_units = 512 # alias = C
num_blocks = 5 # number of encoder/decoder blocks
num_epochs = 20
num_heads = 8
dropout_rate = 0.1
sinusoid = False # If True, use sinusoid. If false, positional embedding.
class feature_Block_Hyperparams:
'''Hyperparameters'''
# data
trainset = './datasets/trainset.txt'
testset = './datasets/testset.txt'
# training
batch_size = 4 # alias = N
lr = 0.0001 # learning rate. In paper, learning rate is adjusted to the global step.
logdir = 'Block_model_dir' # log directory
# model
maxlen = 500 # Maximum number of words in a sentence. alias = T.
# Feel free to increase this if you are ambitious.
min_cnt = 3 # words whose occurred less than min_cnt are encoded as <UNK>.
hidden_units = 512 # alias = C
num_blocks = 5 # number of encoder/decoder blocks
num_epochs = 20
num_heads = 8
dropout_rate = 0.1
sinusoid = False # If True, use sinusoid. If false, positional embedding.
n_class = 2
class infersent_Block_Hyperparams:
'''Hyperparameters'''
# data
trainset = './opensrc_dta/train.csv'
testset = './opensrc_dta/test.csv'
# training
relations = {'entailment': '0', 'contradiction': '1', 'neutral': '2'}
batch_size = 64 # alias = N
lr = 0.0001 # learning rate. In paper, learning rate is adjusted to the global step.
logdir = 'infersent_model_dir' # log directory
# model
maxlen = 24 # Maximum number of words in a sentence. alias = T.
# Feel free to increase this if you are ambitious.
min_cnt = 3 # words whose occurred less than min_cnt are encoded as <UNK>.
hidden_units = 512 # alias = C
num_blocks = 5 # number of encoder/decoder blocks
num_epochs = 20
num_heads = 8
dropout_rate = 0.1
sinusoid = False # If True, use sinusoid. If false, positional embedding.
dropout_keep_prob = 0.55
reg_lambda = 0.1