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

xtol_rel and xtol_abs are not changing. #38

Open
jmcastro2109 opened this issue Jun 13, 2023 · 3 comments
Open

xtol_rel and xtol_abs are not changing. #38

jmcastro2109 opened this issue Jun 13, 2023 · 3 comments

Comments

@jmcastro2109
Copy link

jmcastro2109 commented Jun 13, 2023

Hi, I am trying to finish the local optimizers based on a time limit.

I am using the following code:

local_method = MultistartOptimization.NLoptLocalMethod(NLopt.LN_BOBYQA;  xtol_abs = 0.0, xtol_rel = 0.0, maxtime = 300.0, maxeval = 2000)

multistart_method = MultistartOptimization.TikTak(5000)

p_brute = MultistartOptimization.multistart_minimization(multistart_method, local_method, P_brute; use_threads = false)

However, when the optimization finalizes I get the following return code,

p_brute:(value = 0.004157932864387097, location = [26.98036761207386, 0.39483019850986095, 24.10020993701281, 123.12567045769113, 65.26306039580315, 0.4295685034555466], ret = :XTOL_REACHED)

How is this possible?

@jmcastro2109
Copy link
Author

Re-working the error code

@tpapp
Copy link
Owner

tpapp commented Jun 14, 2023

:XTOL_REACHED means that your coordinates are (practically) not changing, so the optimizer halts. Ie the new x is == the previous one.

Hard to say more without an MWE.

@jmcastro2109
Copy link
Author

jmcastro2109 commented Jun 14, 2023

Hi @tpapp thanks for the answer and sorry for the lack of clarity.

It is difficult to provide a MWE, although hopefully the following code snippet can provide some clarity on what is happening. The minimum should be 0, and for some reason whenever I increase maxeval the objective function does not change. Moreover, it does not return the termination criterium.

local_method = MultistartOptimization.NLoptLocalMethod(NLopt.LN_BOBYQA;  xtol_abs = 0.0, xtol_rel = 0.0, maxtime = 0.0, maxeval = 500)

p_brute = MultistartOptimization.multistart_minimization(multistart_method, local_method, P_brute; use_threads = false)

println("p_brute:", p_brute)

p_brute:(location = [38.04931640625, 0.4683843206787109, 59.28955078125, 93.4814453125, 66.0766604954834, 0.4233642578125], value = 0.1176349004423373)

local_method = MultistartOptimization.NLoptLocalMethod(NLopt.LN_BOBYQA;  xtol_abs = 0.0, xtol_rel = 0.0, maxtime = 0.0, maxeval = 1000)

p_brute = MultistartOptimization.multistart_minimization(multistart_method, local_method, P_brute; use_threads = false)

println("p_brute:", p_brute)

p_brute:(location = [38.04931640625, 0.4683843206787109, 59.28955078125, 93.4814453125, 66.0766604954834, 0.4233642578125], value = 0.1176349004423373)

local_method = MultistartOptimization.NLoptLocalMethod(NLopt.LN_BOBYQA;  xtol_abs = 0.0, xtol_rel = 0.0, maxtime = 0.0, maxeval = 1500)

p_brute = MultistartOptimization.multistart_minimization(multistart_method, local_method, P_brute; use_threads = false)

println("p_brute:", p_brute)

p_brute:(location = [38.04931640625, 0.4683843206787109, 59.28955078125, 93.4814453125, 66.0766604954834, 0.4233642578125], value = 0.1176349004423373)

SMALL UPDATE: it seems to be that what is happening is that when I increase maxeval beyond some number, the optimizer is reporting the smallest value from the initial global phase.
`

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

No branches or pull requests

2 participants