-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstate.py~
executable file
·75 lines (57 loc) · 1.95 KB
/
state.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
from collections import OrderedDict
def prototype_state():
state = {}
# Random seed
state['seed'] = 1234
# Logging level
state['level'] = 'DEBUG'
state['oov'] = '<oov>' # Not used
# These are end-of-sequence marks
state['end_sym_system'] = '</s>'
state['end_sym_turn'] = '</t>'
state['eos_sym'] = 0 # end of system action
state['eot_sym'] = 1 # end of turn symbol
# ----- ACTIV ----
state['sent_rec_activation'] = 'lambda x: T.tanh(x)'
# state['triple_rec_activation'] = 'lambda x: T.tanh(x)'
state['decoder_bias_type'] = 'all' # first, or selective
state['sent_step_type'] = 'gated'
# state['triple_step_type'] = 'gated'
# ----- SIZES ----
# Dimensionality of hidden layers
state['qdim'] = 512
# Dimensionality of triple (higher level) hidden layer
state['sdim'] = 1000
# Dimensionality of low-rank approximation (word embeding)
state['rankdim'] = 256
# Threshold to clip the gradient
state['cutoff'] = 1.
state['lr'] = 0.0001
# Early stopping configuration
state['patience'] = 5
state['cost_threshold'] = 1.003
# ----- TRAINING METHOD -----
# Choose optimization algorithm
state['updater'] = 'adam'
# Maximum sequence length / trim batches
state['seqlen'] = 280
# Batch size
state['bs'] = 80
# Sort by length groups of
state['sort_k_batches'] = 20
# Maximum number of iterations
state['max_iters'] = 10
# Modify this in the prototype
state['save_dir'] = './model'
# ----- TRAINING PROCESS -----
# Frequency of training error reports (in number of batches)
state['train_freq'] = 10
# Validation frequency
state['valid_freq'] = 5000
# Number of batches to process
state['loop_iters'] = 3000000
# Maximum number of minutes to run
state['time_stop'] = 24*60*31
# Error level to stop at
state['minerr'] = -1
return state