提交 ba2305e6 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

flake8 for doc (it's cleaner).

上级 d804254d
...@@ -124,7 +124,7 @@ do is to loop over the entries in *y* and compute the gradient of ...@@ -124,7 +124,7 @@ do is to loop over the entries in *y* and compute the gradient of
>>> import theano.tensor as T >>> import theano.tensor as T
>>> x = T.dvector('x') >>> x = T.dvector('x')
>>> y = x ** 2 >>> y = x ** 2
>>> J, updates = theano.scan(lambda i, y,x : T.grad(y[i], x), sequences=T.arange(y.shape[0]), non_sequences=[y,x]) >>> J, updates = theano.scan(lambda i, y, x : T.grad(y[i], x), sequences=T.arange(y.shape[0]), non_sequences=[y, x])
>>> f = theano.function([x], J, updates=updates) >>> f = theano.function([x], J, updates=updates)
>>> f([4, 4]) >>> f([4, 4])
array([[ 8., 0.], array([[ 8., 0.],
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论