提交 7d74e2c7 authored 作者: James Bergstra's avatar James Bergstra

fixed nnet test to require FAST_RUN mode

上级 50fd6648
...@@ -263,6 +263,10 @@ def test_asymptotic_32(): ...@@ -263,6 +263,10 @@ def test_asymptotic_32():
""" """
This test makes sure that our functions behave sensibly when huge values are present This test makes sure that our functions behave sensibly when huge values are present
""" """
#TODO: consider adding the optimization of crossentropy into the current mode for the
# purpose of running this test
for dtype in 'float32', 'float64': for dtype in 'float32', 'float64':
if dtype == 'float32': if dtype == 'float32':
x = tensor.fmatrix() x = tensor.fmatrix()
...@@ -273,7 +277,7 @@ def test_asymptotic_32(): ...@@ -273,7 +277,7 @@ def test_asymptotic_32():
y = tensor.lvector() y = tensor.lvector()
c = categorical_crossentropy(softmax(x+x2), y) c = categorical_crossentropy(softmax(x+x2), y)
f = theano.function([x,y,x2], [c.sum(), tensor.grad(c, x)]) f = theano.function([x,y,x2], [c.sum(), tensor.grad(c.sum(), x)], mode='FAST_RUN')
if 0: if 0:
for i, n in enumerate( f.maker.env.toposort()): for i, n in enumerate( f.maker.env.toposort()):
print i, n print i, n
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论