提交 cda54d5e authored 作者: Joseph Turian's avatar Joseph Turian

Wrote more in sandbox

上级 d21050ba
...@@ -5,9 +5,22 @@ or correct documentation. ...@@ -5,9 +5,22 @@ or correct documentation.
====================================== ======================================
What happens if grad is not defined? How do you define the grad function?
====================================== ======================================
Let's talk about defining the `grad()` function in an Op, using an
illustrative example.
In Poisson regression (Ranzato and Szummer, 2008), the target *t* is
integer data, which we predict using a continuous output *o*.
In the negative log likelihood of the Poisson regressor, there is a term:
.. math::
\log(t!)
Let's say we write a logfactorial Op. We then compute the gradient
You should define gradient, even if it is undefined. You should define gradient, even if it is undefined.
[give log factorial example] [give log factorial example]
...@@ -170,3 +183,11 @@ More simple numpy stuff ...@@ -170,3 +183,11 @@ More simple numpy stuff
You can also use ``resize`` but there is not reason to ''resize'' You can also use ``resize`` but there is not reason to ''resize''
* How do you convert the type of a numpy array? * How do you convert the type of a numpy array?
``numpy.asarray(x, dtype = 'int32')`` ``numpy.asarray(x, dtype = 'int32')``
=========================================
How to reuse (overwrite) a storage tensor
=========================================
``theano.compile.io.Out(gw1, borrow = True)`` for that value in
``compile.function``
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论