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

Fixing a bunch of typos

上级 9f6df215
...@@ -2725,13 +2725,13 @@ class T_Scan(unittest.TestCase): ...@@ -2725,13 +2725,13 @@ class T_Scan(unittest.TestCase):
grad_fn = theano.function([xinit, w], [gx,gw], grad_fn = theano.function([xinit, w], [gx,gw],
allow_input_downcast = True) allow_input_downcast = True)
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
# If numbers are small, the gradients with respect to x are samll # If numbers are small, the gradients with respect to x are small
# and the numeric differentiation becomes unstable. # and the numeric differentiation becomes unstable.
# To fix this issue I unsreu we are sampling numbers larger then in # To fix this issue I unsure we are sampling numbers larger in
# absolute value then 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,3), low=1., high=3.),
dtype=theano.config.floatX) dtype=theano.config.floatX)
# making some entries to be smaller then 1 # making some entries to be negative
pos = rng.uniform(size=(5, 2, 3), low=0., high=1) < .5 pos = rng.uniform(size=(5, 2, 3), 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.), dtype= theano.config.floatX) v_w = numpy.array(rng.uniform(size=(2,2), low=1., high=3.), dtype= theano.config.floatX)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论