ENH: Return last population of scipy.optimize.differential_evolution
See original GitHub issueIs your feature request related to a problem? Please describe.
Differential evolution is population based algorithm. However, scipy.optimize.differential_evolution returns result as OptimizeResult which gives only the best elite of the population ignoring the rest of its generation.
How can someone preserve information about the last population?
Describe the solution you’d like.
result.x
should be the last population in sorted way. Otherwise, OptimizeResult
should include a new attribute that memorizes the last population.
Describe alternatives you’ve considered.
Right now I have downloaded the source code to work with the class DifferentialEvolutionSolver
directly. So it is possible to make this class available to be imported i.e: from scipy.optimize import DifferentialEvolutionSolver
Additional context (e.g. screenshots, GIFs)
No response
Issue Analytics
- State:
- Created 2 years ago
- Comments:16 (15 by maintainers)
Top Results From Across the Web
scipy.optimize.differential_evolution — SciPy v1.9.3 Manual
Finds the global minimum of a multivariate function. Differential Evolution is stochastic in nature (does not use gradient methods) to find the minimum,...
Read more >Why scipy.optimize.differential_evolution does not return last ...
One way I found to return the last population is to download the source code and work with the class DifferentialEvolutionSolver directly:
Read more >modified _differentialevolution.py to enable parallel evaluation ...
However, I think scipy.optimize needs a common approach to enabling this kind of parallelisation. We don't want to have case-by-case approaches.
Read more >Differential Evolution: An alternative to nonlinear convex ...
Differential Evolution (DE) (Storn & Price, 1997) is an Evolutionary Algorithm ... All of this will be performed using the scipy.optimize Python module....
Read more >A Comparative Study of Differential Evolution Variants in ...
Differential evolution (DE) is a population-based metaheuristic search ... optimization problems are quite challenging to solve due to their ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
In some cases, users want to study the evolution of a specific optimization problem. Returning back the last population is enough since we can always continue evolution from it.
It’d require a bit of thought. Each minimizer is going to want to fill out slightly different attributes of an intermediate
OptimizeResult
. There would have to be a wrapper that could distinguish between the old/new signatures (e.g.state
present as a keyword argument), but I’m not sure if (how much) the wrapper would have to be specialised for each method. It might require that each minimizer method has to be altered, which is not trivial.I think it’d be worth discussing a design before a lot of code is written.