Skip to content

Commit

Permalink
fix incorrect implicit diff H term
Browse files Browse the repository at this point in the history
  • Loading branch information
marius311 committed Aug 27, 2023
1 parent 114123f commit 4e66c41
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/muse.jl
Original file line number Diff line number Diff line change
Expand Up @@ -352,12 +352,12 @@ function get_H!(
ad_fwd, ad_rev = AD.second_lowest(prob.autodiff), AD.lowest(prob.autodiff)

## non-implicit-diff term
H1 = implicit_diff_H1_is_zero ? 𝟘 : copyto!(similar(𝟘), permutedims(first(AD.jacobian(θ₀, backend=ad_fwd) do θ
H1 = implicit_diff_H1_is_zero ? 𝟘 : copyto!(similar(𝟘), first(AD.jacobian(θ₀, backend=ad_fwd) do θ
local x, = sample_x_z(prob, copy(rng), θ)
first(AD.gradient(θ₀, backend=ad_rev) do θ′
logLike(prob, x, ẑ, θ′, UnTransformedθ())
end)
end)))
end))

## term involving dzMAP/dθ via implicit-diff (w/ conjugate-gradient linear solve)
dFdθ = first(AD.jacobian(θ₀, backend=ad_fwd) do θ
Expand Down

0 comments on commit 4e66c41

Please sign in to comment.