-
Notifications
You must be signed in to change notification settings - Fork 15
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
Bug in AutoDiff? #19
Comments
Withdraw the issue. It seems fixed. |
I would however like to know this: |
Yes we have to call AutoDiffJacobianAutoDiff every time to get the Jacobian at different points. There is no differentiated code generated that could be reuse. This library implements forward autodiff through operator overloading. You would need to use a library that does autodiff through source code transformation if you want to have differentiated code (see implementation section here https://en.wikipedia.org/wiki/Automatic_differentiation). |
Can you suggest a similar AutoDiff package for C++? Something that calculates Jacobian. |
I am looking to save on computation time. Or is there a way to make AutoDiff in Matlab faster? |
Also, when calling the function to be differentiated, do we need to set the intermediary variables to type AutoDiff? If I don't, I get the error, cannot convert from type "AutoDiff" to "double". |
"Can you suggest a similar AutoDiff package for C++? Something that calculates Jacobian." "is there a way to make AutoDiff in Matlab faster?". Not sure, you can give a try to atlernative libraries mentioned in the readme. As said in the readme It is likely that the speed could be improved by representing Jacobian matrices by their transpose, due to the way Matlab represents internally sparse matrices. That would necessitate quite a bit of work. It is also sometimes possible to get a significative speed up by rewriting diffrently the function that you want to differentiate (see #1 (comment)). "Also, when calling the function to be differentiated, do we need to set the intermediary variables to type AutoDiff?" that should be done automatically. Have a look at the examples to see that. Do you have a small example you can share to reproduce the problem you are getting? |
|
In the tests I have the lines a = randn(3, 3); The array a is a normal matlab array and it works. I don't have matlab installed to test your line of code but it seems to do the same operation as the lines above. |
No description provided.
The text was updated successfully, but these errors were encountered: