Skip to content

Commit 95bfda8

Browse files
committed
bastin's scheme
1 parent f321c92 commit 95bfda8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/trustRegion.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -532,6 +532,23 @@ function trust_region_step!(cache::TrustRegionCache)
532532
cache.internalnorm(g) < cache.ϵ
533533
cache.force_stop = true
534534
end
535+
elseif radius_update_scheme === RadiusUpdateSchemes.Bastin
536+
if r > cache.step_threshold
537+
take_step!(cache)
538+
cache.loss = cache.loss_new
539+
cache.make_new_J = true
540+
if retrospective_step!(cache) >= cache.expand_threshold
541+
cache.trust_r = max(cache.p1 * cache.internalnorm(step_size), cache.trust_r)
542+
end
543+
544+
else
545+
cache.make_new_J = false
546+
cache.trust_r *= cache.p2
547+
cache.shrink_counter += 1
548+
end
549+
if iszero(cache.fu) || cache.internalnorm(cache.fu) < cache.abstol
550+
cache.force_stop = true
551+
end
535552
end
536553
end
537554

0 commit comments

Comments
 (0)