-
Notifications
You must be signed in to change notification settings - Fork 12
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
Multi-variate output #23
Comments
There's typically little algorithmic benefit from applying reverse mode to a multivariate function versus applying it to a multiple univariate functions that represent the output values of the original function. If you use forward-mode AD then the complexity depends on the input dimension but not the output dimension. |
Thanks for the fast turn around! As I'm relatively new to Julia, is there a simple way to feed a multivariate function through |
Yes, I understand that it's not very convenient to split a multivariate output function into multiple univariate output functions. I don't think that's implemented, I'll let @fredo-dedup comment here. |
Hi all, |
Oh, I didn't notice how similar that one was, sorry for the redundancy. The suggestion there doesn't seem to work on functions however:
I also tried wrapping an expression around it.
I'm guessing there's a metaprogramming solution, but I don't have much experience with that yet. Suggestions? |
Sorry for not providing a more detailed workaround !
Executing |
this works fine for for functions where the derivative is already defined, such as |
This is correct, I can try to take a look if you tell me more about your |
I've just been using the function defined above
as a test case (I have several functions that I would like to be able to run this on). |
The
|
Closing because it is a duplicate. |
So I'm looking for a way to calculate the total derivative in an AD manner, and was somewhat surprised to find that
rdiff
requires that the input function have only one output variable:returns
output variable should be Real, Array{Int64,1} found
.I can see how for order >= 2, it's best to require that the output of the function be a single variable. However, for order 1 it seems perfectly reasonable to look for the total derivative. As far as ways to calculate the total derivative with the code as is, I suppose defining an expression for each coordinate of the function should work, and then stiching it back together using
@eval
, but this seems kludgy to me. Suggestions?The text was updated successfully, but these errors were encountered: