Skip to content

Commit

Permalink
Most 23 test problems now pass
Browse files Browse the repository at this point in the history
  • Loading branch information
avik-pal committed Dec 5, 2023
1 parent 445e97b commit cefe5b0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions src/trustRegion.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,7 @@ function retrospective_step!(cache::TrustRegionCache{iip}) where {iip}
__update_JᵀJ!(cache, J)
__update_Jᵀf!(cache, J)

num = __trust_region_loss(cache, cache.fu) -
__get_trust_region_loss(cache, cache.fu_cache)
num = __trust_region_loss(cache, cache.fu) - __trust_region_loss(cache, cache.fu_cache)
denom = dot(_vec(cache.du), _vec(cache.Jᵀf)) + __lr_mul(cache, cache.JᵀJ, cache.du) / 2
return num / denom
end
Expand Down Expand Up @@ -441,7 +440,7 @@ function trust_region_step!(cache::TrustRegionCache)
end
elseif radius_update_scheme === RadiusUpdateSchemes.Hei
@unpack shrink_threshold, p1, p2, p3, p4 = cache
tr_new = __rfunc(r, shrink_threshold, p1, p3, p4, p2) * cache.internalnorm(du)
tr_new = __rfunc(r, shrink_threshold, p1, p3, p4, p2) * cache.internalnorm(cache.du)
if tr_new < cache.trust_r
cache.shrink_counter += 1
else
Expand Down Expand Up @@ -479,7 +478,7 @@ function trust_region_step!(cache::TrustRegionCache)
elseif radius_update_scheme === RadiusUpdateSchemes.Bastin
if r > cache.step_threshold
if retrospective_step!(cache) cache.expand_threshold
cache.trust_r = max(cache.p1 * cache.internalnorm(du), cache.trust_r)
cache.trust_r = max(cache.p1 * cache.internalnorm(cache.du), cache.trust_r)
end
cache.shrink_counter = 0
else
Expand Down
4 changes: 2 additions & 2 deletions test/23_test_problems.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ end
broken_tests = Dict(alg => Int[] for alg in alg_ops)
broken_tests[alg_ops[1]] = [6, 11, 21]
broken_tests[alg_ops[2]] = [6, 11, 21]
broken_tests[alg_ops[3]] = [1, 6, 11, 12, 15, 16, 21]
broken_tests[alg_ops[4]] = [1, 6, 8, 11, 15, 16, 21, 22]
broken_tests[alg_ops[3]] = [6, 11, 21]
broken_tests[alg_ops[4]] = [6, 11, 21]
broken_tests[alg_ops[5]] = [6, 21]
broken_tests[alg_ops[6]] = [6, 21]

Expand Down

0 comments on commit cefe5b0

Please sign in to comment.