-
Notifications
You must be signed in to change notification settings - Fork 911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to define the grad_func_paramter for a function for defvjp ? #557
Comments
Hi there! Can you say what kind of error you're getting? I think the problem might be that you're using
|
Make sure to do import autograd.scipy as scipy |
Hi @j-towns!
But, in that case autograd no longer traces je as it has been converted to to je._value. Owing to all this, I wrapped the function with primitive decorator. |
And, in my code I need to use scipy.sparse which is not supported by autograd.scipy, so I think using autograd.scipy may not work for me |
When I don't use primitive, this error also pops up TypeError: float() argument must be a string or a number, not 'ArrayBox' |
Hi,
I am a newbie with autograd. I am having difficulty in writing a proper gradient function to use in the defvjp function.
autograd.extend.defvjp(compute_Q , something, something, something... )
Here phi and args are constant so their grad_func should be None, in my opinion.
U and xs are 1d vectors and edof is a 2D vector of indices in a particular order.
Could you help me in structuring the grad_fun for U and xs?
Is this the proper way to write the grad function?
The text was updated successfully, but these errors were encountered: