[英]Is it possible to get the hessian through a gamma function in theano?
b=T.fvector()
theano.gradient.hessian( T.gammaln(b).sum(), [b] )
gives an unnamed NotImplementedError
. 给出一个未命名的
NotImplementedError
。 Since the equivalent code works fine with eg T.log
instead of T.gammaln
I guess theano just doesn't know the second derivation of gammaln
? 由于等效代码可以使用
T.log
而不是T.gammaln
很好地工作, T.gammaln
我猜theano不知道gammaln
的第二次推导吗?
The grad of gammaln use psi. γ的等级使用psi。 But we didn't implement the grad of psi.
但是我们没有实现psi的等级。
You can implement the method grad() of the class Psi in the file theano/scalar/basic_scipy.py. 您可以在文件theano / scalar / basic_scipy.py中实现Psi类的grad()方法。 This would make this case work.
这将使这种情况下可行。
This page of the documentation explain how to add a new Op in Theano and explain how to implement the grad() method: http://deeplearning.net/software/theano/extending/extending_theano.html 文档的本页说明如何在Theano中添加新的Op,并说明如何实现grad()方法: http : //deeplearning.net/software/theano/extending/extending_theano.html
If you need help implementing this, using theano-dev mailing list is better suited then stackoverflow for ongoing discussion. 如果您需要帮助来实现此目的,那么使用theano-dev邮件列表更适合于stackoverflow进行讨论。
If you do it, it would be a great contribution to Theano. 如果您这样做,它将对Theano做出巨大的贡献。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.