如何明确地将可区分函数传递给T.grad?

时间:2017-04-14 05:33:38

标签: theano

请告诉我,如何将各种差异功能传递给T.grad?我想要这样的东西:

x = T.dscalar('x')

ellipic_paraboloid = x ** 2 + y ** 2
hyperbolic_paraboloid = x ** 2 - y ** 2

gradients = theano.function([function_of_xy, x, y], T.grad(function_of_xy, gx, gy))

gradients(ellipic_paraboloid, 1, 1)
gradients(hyperbolic_paraboloid, 1, 1)

0 个答案:

没有答案