Skip to content

Commit beda0dc

Browse files
committed
save next step throughout muse not just at end
1 parent 116930b commit beda0dc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/muse.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,11 @@ function muse!(
230230
θ′ = regularize(θunreg′)
231231
θ = inv_transform_θ(prob, θ′)
232232

233+
# update these as we go for if we stop early
234+
result.θ = θunreg
235+
result.gs = g_like_sims
236+
result.time += t
237+
233238
(checkpoint_filename != nothing) && save(checkpoint_filename, "result", result)
234239

235240
end
@@ -240,9 +245,6 @@ function muse!(
240245

241246
end
242247

243-
result.time += sum(getindex.(history,:t))
244-
result.θ = θunreg
245-
result.gs = history[end].g_like_sims
246248
if get_covariance
247249
get_J!(result, prob; rng, nsims, ∇z_logLike_atol)
248250
get_H!(result, prob; rng, nsims=max(1,nsims÷10), ∇z_logLike_atol)

0 commit comments

Comments
 (0)