Skip to content

Commit

Permalink
Add lstm to the speed test
Browse files Browse the repository at this point in the history
  • Loading branch information
nouiz committed Mar 27, 2015
1 parent ff00edb commit 5eeea37
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions code/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def speed():
"""

algo = ['logistic_sgd', 'logistic_cg', 'mlp', 'convolutional_mlp',
'dA', 'SdA', 'DBN', 'rbm', 'rnnrbm', 'rnnslu']
'dA', 'SdA', 'DBN', 'rbm', 'rnnrbm', 'rnnslu', 'lstm']
to_exec = [True] * len(algo)
# to_exec = [False] * len(algo)
# to_exec[-1] = True
Expand All @@ -87,9 +87,9 @@ def speed():
# 7.1-2 (python 2.7.2, mkl unknow). BLAS with only 1 thread.

expected_times_64 = numpy.asarray([9.8, 22.5, 76.1, 73.7, 116.4,
346.9, 381.9, 558.1, 186.3, 50.8])
346.9, 381.9, 558.1, 186.3, 50.8, 113.6])
expected_times_32 = numpy.asarray([8.1, 17.9, 42.5, 66.5, 71,
191.2, 226.8, 432.8, 176.2, 36.9])
191.2, 226.8, 432.8, 176.2, 36.9, 78.0])

# Number with just 1 decimal are new value that are faster with
# the Theano version 0.5rc2 Other number are older. They are not
Expand All @@ -110,7 +110,7 @@ def speed():

expected_times_gpu = numpy.asarray([3.0, 7.55523491, 18.99226785,
5.8, 21.5,
11.8, 47.9, 290.1, 255.4, 72.4])
11.8, 47.9, 290.1, 255.4, 72.4, 17.0])
expected_times_64 = [s for idx, s in enumerate(expected_times_64)
if to_exec[idx]]
expected_times_32 = [s for idx, s in enumerate(expected_times_32)
Expand Down Expand Up @@ -167,6 +167,8 @@ def do_tests():
# 60 is recommended
'savemodel': False}
time_test(m, l, 9, rnnslu.main, param=s)
time_test(m, l, 10, lstm.train_lstm, max_epochs=1, test_size=1000,
saveto='')
return numpy.asarray(l)

#test in float64 in FAST_RUN mode on the cpu
Expand Down

0 comments on commit 5eeea37

Please sign in to comment.