diff --git a/Project.toml b/Project.toml index 84019f2..ec3212c 100644 --- a/Project.toml +++ b/Project.toml @@ -23,7 +23,7 @@ SparseMatrixColorings = "0a514795-09f3-496d-8182-132a7b665d35" ADTypes = "1" ChainRulesCore = "1" ComponentArrays = "0.15.17" -DifferentiationInterface = "0.6.13 - 0.6.17" +DifferentiationInterface = "0.6.24" Distributions = "0.25" FiniteDiff = "2" ForwardDiff = "0.10" diff --git a/src/MarginalLogDensities.jl b/src/MarginalLogDensities.jl index 115d127..1c0ae01 100644 --- a/src/MarginalLogDensities.jl +++ b/src/MarginalLogDensities.jl @@ -210,8 +210,8 @@ function MarginalLogDensity(logdensity, u, iw, data=(), method=LaplaceApprox(); coloring_algorithm ) end - prep = prepare_hessian(f, hess_adtype, w, Constant(p2)) - H = hessian(f, prep, hess_adtype, w, Constant(p2)) + prep = prepare_hessian(f_opt, hess_adtype, w, Constant(p2)) + H = hessian(f_opt, prep, hess_adtype, w, Constant(p2)) return MarginalLogDensity(logdensity, u, data, iv, iw, method, f_opt, prob, cache, H, hess_adtype, prep) end