From e8778edf3b290ec9c8901673cdccde75c109cb0c Mon Sep 17 00:00:00 2001 From: Chris Rackauckas Date: Fri, 20 Oct 2023 12:07:17 -0400 Subject: [PATCH] a few more oop levenburg --- src/levenberg.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/levenberg.jl b/src/levenberg.jl index 6020738eb..016a12f31 100644 --- a/src/levenberg.jl +++ b/src/levenberg.jl @@ -311,7 +311,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false}) # Require acceptable steps to satisfy the following condition. norm_v = norm(v) if 2 * norm(cache.a) ≤ α_geodesic * norm_v - cache.δ = v .+ cache.a ./ 2 + cache.δ = _restructure(cache.δ,_vec(v) .+ _vec(cache.a) ./ 2) @unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache fu_new = f(u .+ δ, p) cache.stats.nf += 1 @@ -327,7 +327,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false}) return nothing end cache.fu1 = fu_new - cache.v_old = v + cache.v_old = _restructure(cache.v_old,v) cache.norm_v_old = norm_v cache.loss_old = loss cache.λ_factor = 1 / cache.damping_decrease_factor