ForwardDiff.jl
ForwardDiff.jl copied to clipboard
Efficient partial Hessian calculation
Suppose I have a function F(x,y) of two variables x and y where dim(x) << dim(y). What is the most efficient way to calculate both ForwardDiff.jacobian(w1 -> ForwardDiff.gradient(w2 -> F(w2, y), w1), x) and ForwardDiff.jacobian(z -> ForwardDiff.gradient(w -> F(w, z), x),y)? These work, but I'm wondering if there's something faster. I think ForwardDiff.hessian would be way to expensive since I have no need for the second derivative w.r.t. y. I just need the partials \nabla_xxF and \nabla_xyF. Thanks!