Skip to content

Commit c17ccbf

Browse files
committed
Revert log2 change
1 parent 4bdf983 commit c17ccbf

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
@@ -225,7 +225,7 @@ function perform_step!(cache::LevenbergMarquardtCache{true})
225225

226226
# Require acceptable steps to satisfy the following condition.
227227
norm_v = norm(v)
228-
if @fastmath((1 + log2(norm(cache.a)) - log2(norm_v))log2(α_geodesic))
228+
if 2 * norm(cache.a) α_geodesic * norm_v
229229
@. cache.δ = v + cache.a / 2
230230
@unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache
231231
f(cache.fu_tmp, u .+ δ, p)
@@ -286,7 +286,7 @@ function perform_step!(cache::LevenbergMarquardtCache{false})
286286

287287
# Require acceptable steps to satisfy the following condition.
288288
norm_v = norm(v)
289-
if @fastmath((1 + log2(norm(cache.a)) - log2(norm_v))log2(α_geodesic))
289+
if 2 * norm(cache.a) α_geodesic * norm_v
290290
cache.δ = v .+ cache.a ./ 2
291291
@unpack δ, loss_old, norm_v_old, v_old, b_uphill = cache
292292
fu_new = f(u .+ δ, p)

0 commit comments

Comments
 (0)