# HG changeset patch # User Frederic Bastien # Date 1352490506 18000 # Node ID 9c24a2bdbe90aa37daf3a5ae6b8e429d27590472 # Parent 9d21919e2332aab103220bc25a4c85fbab9dcbd9 a test is too slow when run in debugmode, so we force fast_run in that case. diff -r 9d21919e2332 -r 9c24a2bdbe90 pylearn/algorithms/tests/test_mcRBM.py --- a/pylearn/algorithms/tests/test_mcRBM.py Fri Nov 02 13:02:18 2012 -0400 +++ b/pylearn/algorithms/tests/test_mcRBM.py Fri Nov 09 14:48:26 2012 -0500 @@ -24,7 +24,20 @@ persistent_chains=persistent_chains) -def test_reproduce_ranzato_hinton_2010( +def test_reproduce_ranzato_hinton_2010(): + # We need to modify the global mode as otherwise there is a + # function being compiler in the sample that won't use the mode we + # want. + try: + orig_mode = theano.config.mode + if theano.config.mode in ["DebugMode", "DEBUG_MODE"]: + theano.config.mode = "FAST_RUN" + reproduce_ranzato_hinton_2010() + finally: + theano.config.mode = orig_mode + + +def reproduce_ranzato_hinton_2010( dataset='MAR', as_unittest=True, n_train_iters=5000, rbm_alloc=_default_rbm_alloc, trainer_alloc=_default_trainer_alloc, lr_per_example=.075,