esa / pagmo2

A C++ platform to perform parallel computations of optimisation tasks (global and local) via the asynchronous generalized island model.
https://esa.github.io/pagmo2/
GNU General Public License v3.0
823 stars 161 forks source link

Request: No improvement stopping criteria #424

Open DGIorio opened 4 years ago

DGIorio commented 4 years ago

Hello, I would like to request the addition of a stopping criteria that stops the optimization process when there is no improvement in the best fitness in some number of generations. So the user would set a maximum number of generations to stop when there is no improvement.

It may cause some premature exit, but it can reduce the computational effort.

darioizzo commented 4 years ago

I agree that such a stopping criteria is very useful and is missing in pagmo. It would be ideal to implement such a feature at a global level so that its then propagated to all UDAs, but thats difficult as each algorithm behvaior is encapsulated in its evolve method.

As a consequence, all stopping criterias are implemented at the UDA level, so that each UDA have different ones. We try to uniform the stopping criteria across UDAs, but thats done "manually" whenever we implement a UDA. So far the three main stopping criteria we try to have in mind when implementing a UDA are fevals, ftol and xtol.

To conclude, this feature would have to be implemented at the UDA level, and likely cannot be a property of the whole pagmo suite, only of single UDAs.

darioizzo commented 4 years ago

Maybe one could write some external util delegated to check if there were improvement in the champion (only for single objective) over tha last N fevals and signal it to the UDA. This would mean to add in the single UDAs that allow it a call to this util and a new exit point in each of the evolve?

bluescarni commented 4 years ago

I think the best path would be to uniform the behaviour across the existing UDAs wrt stopping criteria, which could probably be done without too much code repetition if we find the right abstraction.

But I think that adding this feature to the general UDA interface would be overengineering.