Skip to content

Commit

Permalink
refactor: remove copy
Browse files Browse the repository at this point in the history
Signed-off-by: Kai Xu <[email protected]>
  • Loading branch information
xukai92 committed Jul 11, 2024
1 parent 2cb2d9e commit c99e006
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/riemannian/integrator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function step(
# Tempering
#r = temper(lf, r, (i=i, is_half=true), n_steps)
# eq (16) of Girolami & Calderhead (2011)
r_half = copy(r_init)
r_half = r_init
local cache
for j = 1:lf.n
# Reuse cache for the first iteration
Expand All @@ -63,7 +63,7 @@ function step(
r_half = r_init - ϵ / 2 * gradient
end
# eq (17) of Girolami & Calderhead (2011)
θ_full = copy(θ_init)
θ_full = θ_init
term_1 = ∂H∂r(h, θ_init, r_half) # unchanged across the loop
for j = 1:lf.n
θ_full = θ_init + ϵ / 2 * (term_1 + ∂H∂r(h, θ_full, r_half))
Expand Down

0 comments on commit c99e006

Please sign in to comment.