From a1bcda6e932dab629fcbde41b53c06fd04694a81 Mon Sep 17 00:00:00 2001 From: marius Date: Wed, 30 Aug 2023 20:40:04 -0700 Subject: [PATCH] allow parameter-dependent step size in `muse` --- src/muse.jl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/muse.jl b/src/muse.jl index 43a634a..aebd81c 100644 --- a/src/muse.jl +++ b/src/muse.jl @@ -225,7 +225,7 @@ function muse!( ) # Newton-Rhapson step - θunreg′ = θ′ .- T(α) .* (H⁻¹_post′ * g_post′) + θunreg′ = θ′ .- T.(α) .* (H⁻¹_post′ * g_post′) θunreg = inv_transform_θ(prob, θunreg′) θ′ = regularize(θunreg′) θ = inv_transform_θ(prob, θ′) @@ -515,7 +515,6 @@ function get_J!( ẑ₀ = @something(z₀, z) ẑ, = ẑ_at_θ(prob, x, ẑ₀, θ₀; ∇z_logLike_atol) g = ∇θ_logLike(prob, x, ẑ, θ₀, UnTransformedθ()) - progress && ProgressMeter.next!(pbar) return g catch err if skip_errors && !(err isa InterruptException) @@ -524,6 +523,8 @@ function get_J!( else rethrow(err) end + finally + progress && ProgressMeter.next!(pbar) end end))