I am executing the following on theano:
>>> import theano
>>> import theano.tensor as T
>>> x = T.dvector('x')
>>> y = T.dvector('y')
>>> f = T.dot(x,y)
>>> Jy= T.Rop(f,x,y)
>>> fun = theano.function([x,y],Jy)
>>> fun([1000,2000,3000],[2,4,8])
array(84.0)
However, if I calculate a simple example by hand I have:
x = [x1,x2,x3]
y = [y1,y2,y3]
f = [x1y1,x2y2,x3y3]
df/dx = |y1, 0, 0|
|0, y2, 0|
|0, 0,y3|
(df/dx)*y = [y1^2, y2^2, y3^2]
Thus I would expect a result of [4, 16, 64]
, but instead I get the sum of these. What is the Rop
calculating differently?