提交 ab65e9c5 authored 作者: Frederic Bastien's avatar Frederic Bastien

make mrg test faster

上级 7dab9f38
...@@ -322,7 +322,7 @@ def test_uniform(): ...@@ -322,7 +322,7 @@ def test_uniform():
#TODO: test size=Var, with shape that change from call to call #TODO: test size=Var, with shape that change from call to call
if mode in ['DEBUG_MODE','FAST_COMPILE']: if mode in ['DEBUG_MODE','FAST_COMPILE']:
sample_size = (10,100) sample_size = (10,100)
steps = int(1e2) steps = 50
else: else:
sample_size = (500,100) sample_size = (500,100)
steps = int(1e3) steps = int(1e3)
...@@ -381,7 +381,7 @@ def test_binomial(): ...@@ -381,7 +381,7 @@ def test_binomial():
if mode in ['DEBUG_MODE','FAST_COMPILE']: if mode in ['DEBUG_MODE','FAST_COMPILE']:
sample_size = (10,50) sample_size = (10,50)
steps = int(1e2) steps = 70
else: else:
sample_size = (500,100) sample_size = (500,100)
steps = int(1e3) steps = int(1e3)
...@@ -428,12 +428,12 @@ def test_binomial(): ...@@ -428,12 +428,12 @@ def test_binomial():
def test_normal0(): def test_normal0():
if config.mode == 'FAST_COMPILE': steps = 50
mode = 'FAST_RUN' if mode in ['DEBUG_MODE','FAST_COMPILE']:
sample_size = (99,100)
else: else:
mode = config.mode sample_size = (999,100)
sample_size = (999,100)
print '' print ''
print 'ON CPU:' print 'ON CPU:'
...@@ -442,12 +442,12 @@ def test_normal0(): ...@@ -442,12 +442,12 @@ def test_normal0():
f = theano.function([], n, mode=mode) f = theano.function([], n, mode=mode)
theano.printing.debugprint(f) theano.printing.debugprint(f)
print 'random?[:10]\n', f()[0,0:10] print 'random?[:10]\n', f()[0,0:10]
basictest(f, 50, sample_size, target_avg=-5.0, target_std=2.0, prefix='mrg ', allow_01=True) basictest(f, steps, sample_size, target_avg=-5.0, target_std=2.0, prefix='mrg ', allow_01=True)
sys.stdout.flush() sys.stdout.flush()
# now with odd number of samples # now with odd number of samples
sample_size = (999,99) sample_size = (sample_size[0],sample_size[1]-1)
print '' print ''
...@@ -474,4 +474,4 @@ def test_normal0(): ...@@ -474,4 +474,4 @@ def test_normal0():
nn = RR.normal(size=sample_size, avg=-5.0, std=2.0) nn = RR.normal(size=sample_size, avg=-5.0, std=2.0)
ff = theano.function([], nn) ff = theano.function([], nn)
basictest(ff, 50, sample_size, target_avg=-5.0, target_std=2.0, prefix='numpy ', allow_01=True) basictest(ff, steps, sample_size, target_avg=-5.0, target_std=2.0, prefix='numpy ', allow_01=True)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论