Skip to content

Commit e8778ed

Browse files
a few more oop levenburg
1 parent 4dbc9f2 commit e8778ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/levenberg.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false})
311311
# Require acceptable steps to satisfy the following condition.
312312
norm_v = norm(v)
313313
if 2 * norm(cache.a) α_geodesic * norm_v
314-
cache.δ = v .+ cache.a ./ 2
314+
cache.δ = _restructure(cache.δ,_vec(v) .+ _vec(cache.a) ./ 2)
315315
@unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache
316316
fu_new = f(u .+ δ, p)
317317
cache.stats.nf += 1
@@ -327,7 +327,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false})
327327
return nothing
328328
end
329329
cache.fu1 = fu_new
330-
cache.v_old = v
330+
cache.v_old = _restructure(cache.v_old,v)
331331
cache.norm_v_old = norm_v
332332
cache.loss_old = loss
333333
cache.λ_factor = 1 / cache.damping_decrease_factor

0 commit comments

Comments
 (0)