File tree Expand file tree Collapse file tree 2 files changed +23
-43
lines changed Expand file tree Collapse file tree 2 files changed +23
-43
lines changed Original file line number Diff line number Diff line change @@ -227,8 +227,27 @@ def load(self, folder):
227
227
228
228
229
229
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
+
232
251
folder = os .path .basename (__file__ ).split ('.' )[0 ]
233
252
if not os .path .exists (folder ):
234
253
os .mkdir (folder )
@@ -341,24 +360,4 @@ def main(param):
341
360
342
361
343
362
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 ()
Original file line number Diff line number Diff line change 15
15
16
16
17
17
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 ()
38
19
39
20
40
21
def test_logistic_sgd ():
You can’t perform that action at this time.
0 commit comments