forked from hycmshyc/RUM
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathptb_configs.py
More file actions
107 lines (101 loc) · 2.32 KB
/
ptb_configs.py
File metadata and controls
107 lines (101 loc) · 2.32 KB
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
def get_config(model):
if model == 'ptb_fs_rum_test':
return ptb_fs_rum_test_config()
if model == 'ptb_fs_rum':
return ptb_fs_rum_config()
elif model == 'ptb_rum_single':
return ptb_rum_single_config()
elif model == 'ptb_rum_double':
return ptb_rum_double_config()
else:
raise ValueError("Invalid model: %s", model)
class ptb_fs_rum_test_config(object):
"""PTB config."""
cell = "fs-rum"
init_scale = 0.01
learning_rate = 0.002
max_grad_norm = 1.0
num_layers = 2
num_steps = 150
cell_size = 200
hyper_size = 200
embed_size = 128
max_epoch = 200
max_max_epoch = max_epoch
keep_prob = 0.65
zoneout_h = 0.9
zoneout_c = 0.5
lr_decay = 0.1
batch_size = 128
vocab_size = 50
fast_layers = 2
T_norm = 1.0
use_zoneout = True
use_layer_norm = True
dataset = 'ptb'
class ptb_fs_rum_config(object):
"""PTB config."""
cell = "fs-rum"
init_scale = 0.01
learning_rate = 0.002
max_grad_norm = 1.0
num_layers = 2
num_steps = 150
cell_size = 700
hyper_size = 1000
embed_size = 128
max_epoch = 200
max_max_epoch = max_epoch
keep_prob = 0.65
zoneout_h = 0.9
zoneout_c = 0.5
lr_decay = 0.1
batch_size = 128
vocab_size = 50
fast_layers = 2
T_norm = 1.0
use_zoneout = True
use_layer_norm = True
dataset = 'ptb'
class ptb_rum_single_config(object):
"""PTB config."""
cell = "rum"
num_steps = 150
learning_rate = 0.002
T_norm = 1.0
num_layers = 1
init_scale = 0.01
max_grad_norm = 1.0
cell_size = 2000
embed_size = 128
max_epoch = 100
max_max_epoch = max_epoch
keep_prob = 0.65
zoneout_h = 0.9
lr_decay = 0.1
batch_size = 128
vocab_size = 50
use_layer_norm = True
use_zoneout = True
dataset = 'ptb'
class ptb_rum_double_config(object):
"""PTB config."""
cell = "rum"
num_steps = 150
learning_rate = 0.002
T_norm = 0.3
num_layers = 2
init_scale = 0.01
max_grad_norm = 1.0
cell_size = 1500
embed_size = 128
max_epoch = 100
max_max_epoch = max_epoch
keep_prob = 0.65
zoneout_h = 0.9
lr_decay = 0.1
batch_size = 128
vocab_size = 50
use_layer_norm = True
use_zoneout = True
dataset = 'ptb'