-
Notifications
You must be signed in to change notification settings - Fork 10
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
Mixed partial derivatives #43
Comments
Not sure if this is the answer you are looking for, but TaylorDiff does have a directional derivative function. While it does not explicitly evaluate a single mixed partial derivatives, you may be able to formulate it to evaluate what you are looking for. I tried real quick to compose a mixed partial derivative using the below code func(x,y) = 2 * x^2 * y^2
derivative( outertemp -> derivative(temp -> func(temp[1],temp[2]), outertemp ,[1f0,0f0],1), [1f0,1f0],[0f0,1f0],1 ) but it looks like TaylorDiff does not currently support taking derivatives of derivatives. I guess it's kinda by design, since the idea is to use the speed of TaylorDiff at directly evaluating higher order derivatives. If you're unfamiliar with the line of code I wrote here's a quick explanation: The This code does error, but this same syntax should work with other packages such as ForwardDiff. If you are just trying to evaluate derivatives for something, ForwardDiff probably has the most support to do what you are looking for. If you are looking to take these derivatives for use in a neural net, TaylorDiff is the only package I've been able to get to play nicely with the Zygote package that Flux uses. |
The goal is to be able to calculate mixed derivatives like as two sequential operation, # v = [x, y]
u(v) = ...
uxx(v) = derivative(u, v, [1., 0.], 2)
uxxyyy(v) = derivative(uxx, v, [0., 1.], 3) So that this will be more efficient than nesting first order derivative for five times. There are currently some code generation problems that prevents me to do that, but I will fix that soon. |
Thanks a lot both for your inputs. |
Is there a way to compute higher order mixed partial derivatives with the current state of the library?
If not, is there a plan to support them in the (near) future?
Thanks! :)
The text was updated successfully, but these errors were encountered: