Closed baggepinnen closed 1 year ago
Predefine the tags. https://github.com/JuliaDiff/SparseDiffTools.jl/blob/master/src/differentiation/jaches_products.jl#L1 for the inner tag, and then out can be like HessianOuterTag
or something.
This should be good to go now
This PR adds ForwardDiff over ForwardDiff for sparse color Hessians. I could not find a good way to solve the chicken-and-egg problem of initializing caches to the correct type, the inner gradient needs a cache element type with a tag that depends on the outer function and vice versa. The current code works, but postpones the creation of the cache until the first call to
autoauto_color_hessian
, when the cache is created and stored in a type-unstable way. I'd be happy to receive suggestions on how to properly initialize the cache objects to avoid this hack.