[SciPy-Dev] differential_evolution enhancement

Andrew Nelson andyfaff at gmail.com
Sun Jan 10 18:29:06 EST 2016


On 9 January 2016 at 05:24, Niklas K. <karcher.niklas at gmail.com> wrote:

> I would like to use the differential_evolution algorithm but extend it
> with a few functionalities:
>
>    1. I would like to use the args arguments also in the callback method
>    so that artificial arguments can be passed to that method as well as to the
>    objective itself.
>
> One of the design goals was to keep the callback function signature the
same as the other minimizers in the scipy.optimize stable.  What's the
rationale for wanting to be able to do this?  You should be able do
something like this already, but in your own code. For example you could
store the args in a class attribute, the class can be callable:

class Mycallback(self):
    def __init__(self, args):
        self.args = args

    def __call__(self, x):
        # implement your callback here. You have access to self.args.
        pass


>
>    1. I would like to use a convex hull as an alternative to the bounds
>    parameter. The type could be checked and the code could behave accordingly.
>    Here the change is a little more difficult since the methods
>    init_population_lhs and init_population_random need to be adopted to the
>    appropriate bounds type. A first approach could be to sample in the
>    designated way (LHS or random) as long as enough samples for the population
>    are present in space defined by the convex hull.
>
> As I understand it a convex hull is the smallest volume that encapsulates
a set of points.  It's not clear to me how a convex hull is applied to the
optimization process here. At the moment the bounds for any given parameter
are fixed during the evolution. Does the use of a convex hull mean that the
bounds for a given parameter can change depending on the value of another
parameter?



> I think that both alterations create a backwards compatible code and can
> be done with a minimal changes. I hope a lead developer could give some
> feedback on my ideas.
>

Not a lead developer, but an interested party. These suggestions are best
dealt with in separate PR's.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20160111/f787be7f/attachment.html>


More information about the SciPy-Dev mailing list