Sometimes one only needs the action of the Hessian on a relatively small number of vectors (e.g. this paper, which uses Lanczos algorithm to estimate the largest eigenvalue of the Hessian using just Hessian-vector-products). In such cases, for high-dimensional models, computing the full Hessian can be very wasteful.
For these cases, it would be useful to add logdensity_and_hessian_vector_product to the API. Ideally one would like to be able to use capabilities to distinguish between a model that just implements logdensity_gradient_and_hessian and logdensity_and_hessian_vector_product.
Notes
Sometimes one only needs the action of the Hessian on a relatively small number of vectors (e.g. this paper, which uses Lanczos algorithm to estimate the largest eigenvalue of the Hessian using just Hessian-vector-products). In such cases, for high-dimensional models, computing the full Hessian can be very wasteful.
For these cases, it would be useful to add
logdensity_and_hessian_vector_productto the API. Ideally one would like to be able to usecapabilitiesto distinguish between a model that just implementslogdensity_gradient_and_hessianandlogdensity_and_hessian_vector_product.Notes
hvpandgradient_and_hvp: https://juliadiff.org/DifferentiationInterface.jl/DifferentiationInterface/stable/api/#DifferentiationInterface.hvp