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

make matrices of same shape so that we can add them

上级 27c5b8e1
...@@ -2898,10 +2898,10 @@ class T_Scan(unittest.TestCase): ...@@ -2898,10 +2898,10 @@ class T_Scan(unittest.TestCase):
# and the numeric differentiation becomes unstable. # and the numeric differentiation becomes unstable.
# To fix this issue I unsure we are sampling numbers larger in # To fix this issue I unsure we are sampling numbers larger in
# absolute value than 1 # absolute value than 1
v_x = numpy.array(rng.uniform(size=(5, 2, 3), low=1., high=3.), v_x = numpy.array(rng.uniform(size=(5, 2, 2), low=1., high=3.),
dtype=theano.config.floatX) dtype=theano.config.floatX)
# making some entries to be negative # making some entries to be negative
pos = rng.uniform(size=(5, 2, 3), low=0., high=1) < .5 pos = rng.uniform(size=(5, 2, 2), low=0., high=1) < .5
v_x[pos] = -1 * v_x[pos] v_x[pos] = -1 * v_x[pos]
v_w = numpy.array(rng.uniform(size=(2, 2), low=1., high=3.), v_w = numpy.array(rng.uniform(size=(2, 2), low=1., high=3.),
dtype=theano.config.floatX) dtype=theano.config.floatX)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论