# HG changeset patch # User Frederic Bastien # Date 1352498790 18000 # Node ID dee27604576861a2f6a17e007802a50262b1301a # Parent 211b217f9691ed740c27f93a1c3bffcc81d3b6eb make test don't run in debug mode as it is too slow. diff -r 211b217f9691 -r dee276045768 pylearn/sampling/tests/test_hmc.py --- a/pylearn/sampling/tests/test_hmc.py Fri Nov 09 16:58:37 2012 -0500 +++ b/pylearn/sampling/tests/test_hmc.py Fri Nov 09 17:06:30 2012 -0500 @@ -62,8 +62,18 @@ def test_hmc(): print ('HMC') - sampler = _sampler_on_2d_gaussian(HMC_sampler.new_from_shared_positions, - burnin=3000 / 20, n_samples=90000 / 20) - assert abs(sampler.avg_acceptance_rate.get_value() - sampler.target_acceptance_rate) < .1 + try: + orig_mode = theano.config.mode + if theano.config.mode in ["DebugMode", "DEBUG_MODE"]: + theano.config.mode = "FAST_RUN" + sampler = _sampler_on_2d_gaussian( + HMC_sampler.new_from_shared_positions, + burnin=3000 / 20, n_samples=90000 / 20) + finally: + theano.config.mode = orig_mode + + + assert abs(sampler.avg_acceptance_rate.get_value() - + sampler.target_acceptance_rate) < .1 assert sampler.stepsize.get_value() >= sampler.stepsize_min assert sampler.stepsize.get_value() <= sampler.stepsize_max