Exactly, I used T.scan() combined with T.grad(). Just to avoid confusion, 
you must to iterate over the variable witch represents the function you 
want to compute derivative, not over the variables w.r.t. Example: f=2*x, 
where x∊R^2. The variable f∊R^2 then T.grad() will not compute its 
derivative w.r.t. x directly. Using T.scan() one can get ∂f[0]/∂x and ∂f[1]/
∂x.

Em quinta-feira, 25 de janeiro de 2018 11:02:59 UTC-3, Nicolás Mercado 
escreveu:
>
> Hey. Thanks for your prompt response.
> Just wanted to ask.... you mean you used a loop over each of the elements 
> w.r.t. you are trying to calculate the partial derivative?
> Did you achieve that with T.scan combined with T.grad, or just a 
> handwritten loop?
>
> Thanks!
>
> El jueves, 25 de enero de 2018, 9:51:49 (UTC-3), Bernardo Biesseck 
> escribió:
>>
>> Yes I solved the problem. Theano doesn't calculate derivatives of vector 
>> with respecto to another vector or matrix, it must be a scalar. To compute 
>> derivative of a vector one can use a loop and use the function T.grad() for 
>> each element. That's what I did.
>>
>> Best regards!
>>
>> Em quinta-feira, 25 de janeiro de 2018 01:38:00 UTC-3, Nicolás Mercado 
>> escreveu:
>>>
>>> Were you able to fine a workaround?
>>> My suggestion is to use T.Lop instead of T.grad.
>>
>>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"theano-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to