提交 a50e760a authored 作者: Gokul's avatar Gokul

docstring fix

上级 c98a1668
...@@ -2084,16 +2084,17 @@ def grad_scale(x, multiplier): ...@@ -2084,16 +2084,17 @@ def grad_scale(x, multiplier):
:param multiplier: scale of the gradient :param multiplier: scale of the gradient
:examples: :examples:
x = theano.tensor.fscalar()
fx = theano.tensor.sin(x)
fp = theano.tensor.grad(fx, wrt=x) x = theano.tensor.fscalar()
fprime = theano.function([x], fp) fx = theano.tensor.sin(x)
print(fprime(2))#-0.416
f_inverse=grad_scale(fx,-1.) fp = theano.tensor.grad(fx, wrt=x)
fpp = theano.tensor.grad(f_inverse, wrt=x) fprime = theano.function([x], fp)
fpprime = theano.function([x], fpp) print(fprime(2))#-0.416
print(fpprime(2))#0.416
f_inverse=grad_scale(fx,-1.)
fpp = theano.tensor.grad(f_inverse, wrt=x)
fpprime = theano.function([x], fpp)
print(fpprime(2))#0.416
""" """
return GradScale(multiplier)(x) return GradScale(multiplier)(x)
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论