Skip to content

Commit ada4162

Browse files
author
Grégoire
committed
remove dictionnary duplication
1 parent 74aba5c commit ada4162

File tree

2 files changed

+23
-43
lines changed

2 files changed

+23
-43
lines changed

code/rnnslu.py

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,27 @@ def load(self, folder):
227227

228228

229229

230-
def main(param):
231-
230+
def main(param=None):
231+
if not param:
232+
param = {'fold': 3,
233+
# 5 folds 0,1,2,3,4
234+
'data': 'atis',
235+
'lr': 0.0970806646812754,
236+
'verbose': 1,
237+
'decay': True,
238+
# decay on the learning rate if improvement stops
239+
'win': 7,
240+
# number of words in the context window
241+
'nhidden': 200,
242+
# number of hidden units
243+
'seed': 345,
244+
'emb_dimension': 50,
245+
# dimension of word embedding
246+
'nepochs': 60,
247+
# 60 is recommended
248+
'savemodel': False}
249+
print param
250+
232251
folder = os.path.basename(__file__).split('.')[0]
233252
if not os.path.exists(folder):
234253
os.mkdir(folder)
@@ -341,24 +360,4 @@ def main(param):
341360

342361

343362
if __name__ == '__main__':
344-
# best model
345-
s = {'fold': 3,
346-
# 5 folds 0,1,2,3,4
347-
'data': 'atis',
348-
'lr': 0.0970806646812754,
349-
'verbose': 1,
350-
'decay': True,
351-
# decay on the learning rate if improvement stops
352-
'win': 7,
353-
# number of words in the context window
354-
'nhidden': 200,
355-
# number of hidden units
356-
'seed': 345,
357-
'emb_dimension': 50,
358-
# dimension of word embedding
359-
'nepochs': 60,
360-
# 60 is recommended
361-
'savemodel': False}
362-
363-
print s
364-
main(s)
363+
main()

code/test.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,7 @@
1515

1616

1717
def test_rnnslu():
18-
# best model
19-
s = {'fold': 3,
20-
# 5 folds 0,1,2,3,4
21-
'data': 'atis',
22-
'lr': 0.0970806646812754,
23-
'verbose': 1,
24-
'decay': True,
25-
# decay on the learning rate if improvement stops
26-
'win': 7,
27-
# number of words in the context window
28-
'nhidden': 200,
29-
# number of hidden units
30-
'seed': 345,
31-
'emb_dimension': 50,
32-
# dimension of word embedding
33-
'nepochs': 1,
34-
# 60 is recommended
35-
'savemodel': False}
36-
37-
rnnslu.main(s)
18+
rnnslu.main()
3819

3920

4021
def test_logistic_sgd():

0 commit comments

Comments
 (0)