Skip to content

Commit

Permalink
Revert log2 change
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Oct 5, 2023
1 parent 4bdf983 commit c17ccbf
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 @@ -225,7 +225,7 @@ function perform_step!(cache::LevenbergMarquardtCache{true})

# Require acceptable steps to satisfy the following condition.
norm_v = norm(v)
if @fastmath((1 + log2(norm(cache.a)) - log2(norm_v))log2(α_geodesic))
if 2 * norm(cache.a) α_geodesic * norm_v

Check warning on line 228 in src/levenberg.jl

View check run for this annotation

Codecov / codecov/patch

src/levenberg.jl#L228

Added line #L228 was not covered by tests
@. cache.δ = v + cache.a / 2
@unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache
f(cache.fu_tmp, u .+ δ, p)
Expand Down Expand Up @@ -286,7 +286,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false})

# Require acceptable steps to satisfy the following condition.
norm_v = norm(v)
if @fastmath((1 + log2(norm(cache.a)) - log2(norm_v))log2(α_geodesic))
if 2 * norm(cache.a) α_geodesic * norm_v

Check warning on line 289 in src/levenberg.jl

View check run for this annotation

Codecov / codecov/patch

src/levenberg.jl#L289

Added line #L289 was not covered by tests
cache.δ = v .+ cache.a ./ 2
@unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache
fu_new = f(u .+ δ, p)
Expand Down

0 comments on commit c17ccbf

Please sign in to comment.