提交 b873707b authored 作者: Razvan Pascanu's avatar Razvan Pascanu

we need to use large enough numbers in the test

Otherwise the numberic differentiation gradient quickly becomes numerically unstable.
上级 809d0546
......@@ -2725,9 +2725,9 @@ class T_Scan(unittest.TestCase):
grad_fn = theano.function([xinit, w], [gx,gw],
allow_input_downcast = True)
rng = numpy.random.RandomState(utt.fetch_seed())
v_x = numpy.array(rng.uniform(size=(5,2,3), low=-2., high=2.),
v_x = numpy.array(rng.uniform(size=(5,2,3), low=-3., high=3.),
dtype=theano.config.floatX)
v_w = numpy.array(rng.uniform(size=(2,2)), dtype= theano.config.floatX)
v_w = numpy.array(rng.uniform(size=(2,2), low=-3., high=3.), dtype= theano.config.floatX)
analytic_grad = grad_fn(v_x, v_w)
num_grad = multiple_outputs_numeric_grad(cost_fn,
[v_x, v_w])
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论