提交 8e158ada authored 作者: Frederic Bastien's avatar Frederic Bastien

make test faster in debug mode.

上级 105f70a4
#!/usr/bin/env python #!/usr/bin/env python
import numpy as N import numpy as N
import theano
from theano import Op, Apply, tensor as T, Module, Method, Mode, compile from theano import Op, Apply, tensor as T, Module, Method, Mode, compile
from theano.gof import OpSub, TopoOptimizer from theano.gof import OpSub, TopoOptimizer
...@@ -214,12 +215,18 @@ def test_example_rnn(): ...@@ -214,12 +215,18 @@ def test_example_rnn():
print i, node print i, node
niter=1500 niter=1500
if theano.config.mode=='DEBUG_MODE':
niter=30
for i in xrange(niter): for i in xrange(niter):
if i % 100 == 0: if i % 100 == 0:
print i, rnn.minimizer.step_cost(x, y), rnn.minimizer.stepsize print i, rnn.minimizer.step_cost(x, y), rnn.minimizer.stepsize
else: else:
rnn.minimizer.step_cost(x, y) rnn.minimizer.step_cost(x, y)
assert rnn.minimizer.step_cost(x,y) < -20 #it starts around -.28 if theano.config.mode=='DEBUG_MODE':
assert rnn.minimizer.step_cost(x,y) < -.9 #it starts around -.28
else:
assert rnn.minimizer.step_cost(x,y) < -20 #it starts around -.28
def test_WEIRD_STUFF(): def test_WEIRD_STUFF():
n_vis = 3 n_vis = 3
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论