changeset 926:995b50f0c2ee

make test faster in debug mode
author Frederic Bastien <nouiz@nouiz.org>
date Wed, 31 Mar 2010 15:18:09 -0400
parents 6be337c30928
children ffaf94da8100
files pylearn/shared/layers/tests/test_lecun1998.py
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pylearn/shared/layers/tests/test_lecun1998.py	Wed Mar 31 15:17:40 2010 -0400
+++ b/pylearn/shared/layers/tests/test_lecun1998.py	Wed Mar 31 15:18:09 2010 -0400
@@ -1,8 +1,12 @@
 from pylearn.shared.layers.lecun1998 import *
 from pylearn.shared.layers import LogisticRegression
+from theano.compile.debugmode import DebugMode
 import theano.sandbox.softsign
 
 def test_w_random(bsize=10, n_iter=100, dtype='float64'):
+    if isinstance(theano.compile.mode.get_default_mode(),DebugMode):
+        n_iter=2
+
     ishape=(28,28)
     fshape=(5,5)
     if dtype == 'float64':
@@ -30,7 +34,8 @@
         print i, 'rval', fN
 
     assert f0 > 6
-    assert fN < .3
+    if not isinstance(theano.compile.mode.get_default_mode(),DebugMode):
+        assert fN < .3
 
 
 def test_squash():