Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve SAMIN convergence message, fix issue #960 #988

Merged
merged 15 commits into from
Sep 4, 2022
Merged

improve SAMIN convergence message, fix issue #960 #988

merged 15 commits into from
Sep 4, 2022

Conversation

mcreel
Copy link
Contributor

@mcreel mcreel commented Jun 3, 2022

This PR makes SAMIN report function and parameter convergence messages so that they are correctly reported to Optim, and convergence is correctly displayed.

The code

using Optim
rosenbrock(x, p) =  (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2

function main()
x0 = zeros(2)
p  = [1.0, 100.0]
obj = x -> rosenbrock(x,p)
lb = fill(-100., 2)
ub = fill(100., 2)
prob = Optim.optimize(obj, lb, ub, x0, SAMIN(), Optim.Options(iterations=10^6))
end
main()

now gives the output

julia> include("CheckSAMIN.jl")
================================================================================
SAMIN results
==> Normal convergence <==
total number of objective function evaluations: 23801

     Obj. value:      0.0000000000

       parameter      search width
         1.00000           0.00000 
         1.00000           0.00000 
================================================================================

 * Status: success

 * Candidate solution
    Final objective value:     8.834636e-17

 * Found with
    Algorithm:     SAMIN

 * Convergence measures
    |x - x'|               = 2.07e-07 ≤ 1.0e-06
    |x - x'|/|x'|          = NaN ≰ 0.0e+00
    |f(x) - f(x')|         = 4.39e-13 ≤ 1.0e-12
    |f(x) - f(x')|/|f(x')| = NaN ≰ 0.0e+00
    |g(x)|                 = NaN ≰ 0.0e+00

``

@codecov
Copy link

codecov bot commented Jun 3, 2022

Codecov Report

Merging #988 (75990d2) into master (d5cb5da) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master     #988      +/-   ##
==========================================
+ Coverage   85.34%   85.41%   +0.07%     
==========================================
  Files          42       42              
  Lines        3187     3189       +2     
==========================================
+ Hits         2720     2724       +4     
+ Misses        467      465       -2     
Impacted Files Coverage Δ
src/multivariate/solvers/constrained/samin.jl 78.82% <100.00%> (+1.44%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d5cb5da...75990d2. Read the comment docs.

@pkofod pkofod linked an issue Sep 4, 2022 that may be closed by this pull request
@pkofod
Copy link
Member

pkofod commented Sep 4, 2022

Thanks a lot!

@pkofod pkofod merged commit be30ce7 into JuliaNLSolvers:master Sep 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

misleading convergence message for SAMIN
2 participants