12
12
import rnnrbm
13
13
import SdA
14
14
import rnnslu
15
+ import lstm
15
16
16
17
17
18
def test_rnnslu ():
@@ -61,13 +62,17 @@ def test_rnnrbm():
61
62
rnnrbm .test_rnnrbm (num_epochs = 1 )
62
63
63
64
65
+ def test_lstm ():
66
+ lstm .train_lstm (max_epochs = 1 , test_size = 1000 , saveto = '' )
67
+
68
+
64
69
def speed ():
65
70
"""
66
71
This fonction modify the configuration theano and don't restore it!
67
72
"""
68
73
69
74
algo = ['logistic_sgd' , 'logistic_cg' , 'mlp' , 'convolutional_mlp' ,
70
- 'dA' , 'SdA' , 'DBN' , 'rbm' , 'rnnrbm' , 'rnnslu' ]
75
+ 'dA' , 'SdA' , 'DBN' , 'rbm' , 'rnnrbm' , 'rnnslu' , 'lstm' ]
71
76
to_exec = [True ] * len (algo )
72
77
# to_exec = [False] * len(algo)
73
78
# to_exec[-1] = True
@@ -82,9 +87,9 @@ def speed():
82
87
# 7.1-2 (python 2.7.2, mkl unknow). BLAS with only 1 thread.
83
88
84
89
expected_times_64 = numpy .asarray ([9.8 , 22.5 , 76.1 , 73.7 , 116.4 ,
85
- 346.9 , 381.9 , 558.1 , 186.3 , 50.8 ])
90
+ 346.9 , 381.9 , 558.1 , 186.3 , 50.8 , 113.6 ])
86
91
expected_times_32 = numpy .asarray ([8.1 , 17.9 , 42.5 , 66.5 , 71 ,
87
- 191.2 , 226.8 , 432.8 , 176.2 , 36.9 ])
92
+ 191.2 , 226.8 , 432.8 , 176.2 , 36.9 , 78.0 ])
88
93
89
94
# Number with just 1 decimal are new value that are faster with
90
95
# the Theano version 0.5rc2 Other number are older. They are not
@@ -104,8 +109,8 @@ def speed():
104
109
# 1.35324519 1.7356905 1.12937868]
105
110
106
111
expected_times_gpu = numpy .asarray ([3.0 , 7.55523491 , 18.99226785 ,
107
- 5.8 , 21 .5 ,
108
- 11.8 , 47.9 , 290.1 , 255.4 , 72.4 ])
112
+ 5.8 , 20 .5 ,
113
+ 11.8 , 47.9 , 290.1 , 255.4 , 72.4 , 17.0 ])
109
114
expected_times_64 = [s for idx , s in enumerate (expected_times_64 )
110
115
if to_exec [idx ]]
111
116
expected_times_32 = [s for idx , s in enumerate (expected_times_32 )
@@ -162,6 +167,8 @@ def do_tests():
162
167
# 60 is recommended
163
168
'savemodel' : False }
164
169
time_test (m , l , 9 , rnnslu .main , param = s )
170
+ time_test (m , l , 10 , lstm .train_lstm , max_epochs = 1 , test_size = 1000 ,
171
+ saveto = '' )
165
172
return numpy .asarray (l )
166
173
167
174
#test in float64 in FAST_RUN mode on the cpu
0 commit comments