Open omalled opened 2 years ago
Yeah... that's why it said "should" in the "Roadmap" section of the docs 😅. A lot of cases end up working out since it just differentiates the algorithm, and things like lu
/qr
/svd
have ChainRules defined on them so a lot of cases "accidentally" work. But what we need to do is lower to solve_ab(A,b,sensealg,alg)
etc. and then define the chain rule on that, which is the same as https://github.com/JuliaDiff/ChainRules.jl/blob/main/src/rulesets/Base/arraymath.jl#L336-L359 .
Then it just needs a solve on the adjoint, i.e. https://github.com/SciML/LinearSolve.jl/issues/92
I saw in the docs that "the current algorithms should support automatic differentiation," and played around with it a bit. My ultimate goal is to get a Hessian-vector product working (similar to this issue in AlgebraicMultigrid, which was never resolved despite some effort being made). However, I wasn't able to get a Hessian-vector product or even a gradient working in a relatively simple example:
Is there any chance to get these derivatives working with LinearSolve? It would be really great, especially the Hessian-vector products. Thanks for your help and your great work on this package! Please let me know if there's something I can do to help get this working 😄