提交 0198fa75 authored 作者: James Bergstra's avatar James Bergstra

added some more tests of log_add-related functionality... they do not pass but soon they should

上级 28e5b5cd
......@@ -943,9 +943,23 @@ def test_log_add():
theano.printing.debugprint( f)
print f([10000], [10000]) # causes overflow if handled incorrectly
assert numpy.allclose(f([10000], [10000]), 10000+numpy.log1p(1))
# test that it also works with more than two args, (this currently fails)
x = dvector()
y = dvector()
f = function([x,y], T.log(T.exp(x) + T.exp(y) + T.exp(x-y) + T.exp(x+y)), mode=m)
theano.printing.debugprint( f)
print f([10000], [10000]) # causes overflow if handled incorrectly
assert numpy.allclose(f([10000], [10000]), 20000)
#TODO: test that the optimization works in the presence of broadcasting.
#TODO: (write and) test that the optimization works with Sum in addition to working with Add.
class test_local_subtensor_unary(unittest.TestCase):
def test0(self):
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论