提交 fc23d857 authored 作者: Olivier Delalleau's avatar Olivier Delalleau

Typo fix + added a note on testing gradients

Otherwise it may confuse users as nothing is printed to screen when it works.
上级 c15fa3c0
...@@ -149,11 +149,10 @@ Test it! ...@@ -149,11 +149,10 @@ Test it!
Testing the gradient Testing the gradient
-------------------- --------------------
The function :ref:`verify_grad The function :ref:`verify_grad <validating_grad>`
<validating_grad>` verifies the gradient of an Op or Theano graph. It compares the
verify the gradient of an Op or Theano graph. It compare the analytic (symbolically computed) gradient and the numeric
analytic(symbolicaly computed) gradient and the numeric gradient (computed through the Finite Difference Method).
gradient(computed through the Finite Difference Method).
To verify the grad method of the DoubleOp, you can use this: To verify the grad method of the DoubleOp, you can use this:
...@@ -163,6 +162,9 @@ To verify the grad method of the DoubleOp, you can use this: ...@@ -163,6 +162,9 @@ To verify the grad method of the DoubleOp, you can use this:
import theano.tests import theano.tests
theano.tests.unittest_tools.verify_grad(DoubleOp(), [numpy.random.rand(5,7,2)]) theano.tests.unittest_tools.verify_grad(DoubleOp(), [numpy.random.rand(5,7,2)])
If nothing happens, then it works! If you want to see it fail, you can
implement a wrong gradient (for instance removing the multiplication by 2).
Exercises 8 Exercises 8
----------- -----------
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论