Skip to content

Commit 8f1ebc5

Browse files
committed
Use hessian symmetry for jacobian of hessian
1 parent 7d4a86f commit 8f1ebc5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

research/src/riemannian_hmc_utility.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function gen_∂G∂θ_fwd(Vfunc, x; f=identity)
4545
out = zeros(eltype(x), d^2, d)
4646

4747
function ∂G∂θ_fwd(y)
48-
hess = z -> ForwardDiff.hessian(Vfunc, z, hess_cfg, Val{false}())
48+
hess = z -> Symmetric(ForwardDiff.hessian(Vfunc, z, hess_cfg, Val{false}()))
4949
ForwardDiff.jacobian!(out, hess, y, jac_cfg, Val{false}())
5050
return out
5151
end

0 commit comments

Comments
 (0)