[SciPy-Dev] diifferential_evolution - moving core loop of solve method into a generator function

Andrew Nelson andyfaff at gmail.com
Sun Dec 13 19:37:53 EST 2015


Dear devs,
I'd like to submit a PR to extract the population evolving loop in the
DifferentialEvolutionSolver.solve method (currently ~L500 in
_differentialevolution.py), and put it into a generator function
(called evolve). This means that the population evolution would occur
by the solve method advancing the evolve generator repeatedly.

This would not appear to have any use if one is calling the
differential_evolution function. However, if one uses the
DifferentialEvolutionSolver class then you could:

1) Inspect the population after every evolved generation (if you call
the evolve generator directly, instead of through solve). You can then
apply your own convergence criterion to the optimization.
2) it breaks up the solve method into smaller pieces.
3) for me it's a little more pythonic.

Comments, questions?
_____________________________________
Dr. Andrew Nelson


_____________________________________



More information about the SciPy-Dev mailing list