Skip to content

Commit

Permalink
a few more oop levenburg
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Oct 20, 2023
1 parent 4dbc9f2 commit e8778ed
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/levenberg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit e8778ed

Please sign in to comment.