Skip to content

Commit 50b5010

Browse files
committed
Merge pull request lisa-lab#131 from nouiz/master2
Master2
2 parents 87460ee + 87b2f9a commit 50b5010

File tree

3 files changed

+25
-6
lines changed

3 files changed

+25
-6
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
- PART="test.py:test_logistic_sgd test.py:test_logistic_cg test.py:test_mlp test.py:test_convolutional_mlp test.py:test_dA"
2424
- PART="test.py:test_SdA test.py:test_lstm"
2525
- PART="test.py:test_dbn"
26-
- PART="test.py:test_rbm test.py:test_rnnrbm"
26+
- PART="test.py:test_rbm test.py:test_rnnrbm test.py:test_rnnslu"
2727
- PART="-e test.py"
2828

2929
#i7-2600K CPU @ 3.40GHz

code/rnnslu.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,14 @@ def get_perf(filename, folder):
126126
stdout=subprocess.PIPE)
127127

128128
stdout, _ = proc.communicate(''.join(open(filename).readlines()))
129+
out = None
129130
for line in stdout.split('\n'):
130131
if 'accuracy' in line:
131132
out = line.split()
132133
break
133-
134+
# To help debug
135+
if out is None:
136+
print stdout.split('\n')
134137
precision = float(out[6][:-2])
135138
recall = float(out[8][:-2])
136139
f1score = float(out[10])

code/test.py

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
import lstm
1616

1717

18-
def test_rnnslu():
19-
rnnslu.main()
20-
21-
2218
def test_logistic_sgd():
2319
logistic_sgd.sgd_optimization_mnist(n_epochs=10)
2420

@@ -62,6 +58,26 @@ def test_rnnrbm():
6258
rnnrbm.test_rnnrbm(num_epochs=1)
6359

6460

61+
def test_rnnslu():
62+
s = {'fold': 3,
63+
# 5 folds 0,1,2,3,4
64+
'data': 'atis',
65+
'lr': 0.0970806646812754,
66+
'verbose': 1,
67+
'decay': True,
68+
# decay on the learning rate if improvement stops
69+
'win': 7,
70+
# number of words in the context window
71+
'nhidden': 200,
72+
# number of hidden units
73+
'seed': 345,
74+
'emb_dimension': 50,
75+
# dimension of word embedding
76+
'nepochs': 1, # CHANGED
77+
'savemodel': False}
78+
rnnslu.main(s)
79+
80+
6581
def test_lstm():
6682
lstm.train_lstm(max_epochs=1, test_size=1000, saveto='')
6783

0 commit comments

Comments
 (0)