-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathconfig.py
58 lines (51 loc) · 1.23 KB
/
config.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
def get_config(conf):
if conf == "small":
return SmallConfig
elif conf == "medium":
return MediumConfig
elif conf == "large":
return LargeConfig
else:
raise ValueError('did not enter acceptable model config:', conf)
class SmallConfig(object):
"""Small config."""
init_scale = 0.1
learning_rate = 1.0
learning_rate_decay = 0.5
max_grad_norm = 5
num_layers = 2
num_steps = 200
embedding_size = 200
hidden_size = 20
max_epoch = 1000000
batch_size = 20
vocab_size = 10000
summary_frequency = 10
class MediumConfig(object):
"""Medium config."""
init_scale = 0.05
learning_rate = 1.0
learning_rate_decay = 0.8
max_grad_norm = 5
num_layers = 2
num_steps = 35
embedding_size = 650
hidden_size = 650
max_epoch = 1000000
batch_size = 32
vocab_size = 10000
summary_frequency = 10
class LargeConfig(object):
"""Large config."""
init_scale = 0.04
learning_rate = 0.0005
learning_rate_decay = 1/1.15
max_grad_norm = 10
num_layers = 2
num_steps = 35
embedding_size = 300
hidden_size = 1500
max_epoch = 1000000
batch_size = 32
vocab_size = 10000
summary_frequency = 10