File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,13 @@ states as `RadiusUpdateSchemes.T`. Simply put the desired scheme as follows:
32
32
"""
33
33
NLsolve
34
34
35
+ """
36
+ `RadiusUpdateSchemes.NLsolve`
37
+
38
+ Nocedal and Wright updating scheme
39
+ """
40
+ NW
41
+
35
42
"""
36
43
`RadiusUpdateSchemes.Hei`
37
44
@@ -436,6 +443,22 @@ function trust_region_step!(cache::TrustRegionCache)
436
443
if iszero (cache. fu) || cache. internalnorm (cache. fu) < cache. abstol
437
444
cache. force_stop = true
438
445
end
446
+
447
+ elseif radius_update_scheme === RadiusUpdateSchemes. NW
448
+ # accept/reject decision
449
+ if r > cache. step_threshold # accept
450
+ take_step! (cache)
451
+ cache. loss = cache. loss_new
452
+ cache. make_new_J = true
453
+ else # reject
454
+ cache. make_new_J = false
455
+ end
456
+
457
+ if r < 1 // 4
458
+ cache. trust_r = (1 // 4 ) * norm (cache. step_size)
459
+ elseif (r > (3 // 4 )) && abs (norm (cache. step_size) - cache. trust_r)/ cache. trust_r < 1e-6
460
+ cache. trust_r = min (2 * cache. trust_r, cache. max_trust_r)
461
+ end
439
462
440
463
elseif radius_update_scheme === RadiusUpdateSchemes. Hei
441
464
if r > cache. step_threshold
You can’t perform that action at this time.
0 commit comments