Open tueda opened 3 years ago
i also have stalling problem with COBYLA. in my case it seems to get stuck in the trstlp-function (https://github.com/stevengj/nlopt/blob/master/src/algs/cobyla/cobyla.c#L1247-L1250). this function does not take the stop-criteria into account. have problem both on 2.4.2 and master.
reproducer of it stalling is here:
https://github.com/jehelset/nlopt/blob/cobyla_trstlp_stalling/test/cobyla_trstlp_stalling.cpp
@jehelset @stevengj This problem seems to be happening quite often in problems I am trying to solve using cobyla. Is there a simple workaround to the infinite looping that happens in the trustlp routine? I am not too familiar with the algorithm so don't want to break it with my changes, some advice on what can be done safely would be much appreciated.
I guess setting
maxeval
ormaxtime
must guarantee that optimization algorithms finish anyway (or possibly raise an exception). With the following settings,opt.optimize()
never returns (though I can make a workaround, for example, by changing the algorithm or putting other stopping criteria).If I use
opt.set_maxeval(667)
in the above code, then somehow it returns with the correct answer[0, 0]
.Just in case, I am testing with the following versions (on Google Colab):
(I'm not sure why
pip
doesn't pick up 2.6.2).