Module Expr Str ImportFrom alias alias alias Import alias identifier ImportFrom alias alias ImportFrom alias Import alias Assign NameStore ListLoad Str Assign NameStore AttributeLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults TupleLoad Str Num Num Num TupleLoad Num Num Num NameLoad NameLoad NameLoad NameLoad Str body Expr Str Assign NameStore Call NameLoad NameLoad NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad Return Call AttributeLoad NameLoad attr decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str Assign NameStore Dict Str Str Str Str Str Str Str Str Str Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults TupleLoad Str Num Num Num TupleLoad Num Num Num NameLoad AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Str body If CompareIn NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse If CompareIn NameLoad AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr Call NameLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad orelse Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad If BoolOpOr UnaryOpNot Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr CompareGtE Call AttributeLoad NameLoad attr NameLoad Num Call AttributeLoad NameLoad attr CompareLt Call AttributeLoad NameLoad attr NameLoad Num body Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad If BoolOpAnd Call NameLoad NameLoad Str CompareGt Call NameLoad NameLoad Num body Assign AttributeStore NameLoad attr ListLoad SubscriptLoad NameLoad Index Num SubscriptLoad NameLoad Index Num Expr Call AttributeLoad AttributeLoad NameLoad attr attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr AttributeLoad Call AttributeLoad NameLoad attr NameLoad keyword Str attr If BoolOpOr CompareNotEq Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Num UnaryOpNot Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise Call NameLoad Str If CompareIs NameLoad NameLoad body Assign NameStore Num Assign AttributeStore NameLoad attr NameLoad If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr BinOpMult Num BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call NameLoad NameLoad Assign AttributeStore NameLoad attr BinOpMult NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr orelse If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr orelse Raise Call NameLoad Str Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpDiv Num AttributeLoad NameLoad attr Assign NameStore BinOpAdd BinOpMult NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Num Num AttributeLoad NameLoad attr keyword NameLoad ExtSlice Slice Index AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad For NameStore Call NameLoad AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Slice Index NameLoad SubscriptLoad NameLoad Index TupleLoad NameLoad NameLoad Assign AttributeStore NameLoad attr BinOpMult Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpMult Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Return BinOpDiv Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpAdd Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list NameLoad FunctionDef arguments args NameParam defaults body Expr Str Assign TupleStore NameStore NameStore TupleLoad Num NameLoad Assign NameStore SubscriptLoad NameLoad Index Str If Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr For NameStore Call NameLoad Num BinOpAdd AttributeLoad NameLoad attr Num body TryExcept body Expr Call NameLoad NameLoad handlers ExceptHandler type NameLoad body Assign NameStore NameLoad Assign NameStore SubscriptLoad NameLoad Index Str Break If AttributeLoad NameLoad attr body Expr Call NameLoad BinOpMod Str TupleLoad NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign NameStore AttributeLoad NameLoad attr If BoolOpAnd AttributeLoad NameLoad attr CompareIs Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num keyword BinOpDiv AttributeLoad NameLoad attr NameLoad NameLoad body Assign NameStore NameLoad Assign NameStore Str Break If BoolOpOr CompareLt NameLoad AttributeLoad NameLoad attr NameLoad body Break orelse Assign NameStore SubscriptLoad NameLoad Index Str Assign NameStore NameLoad Assign NameStore Call NameLoad keyword AttributeLoad NameLoad attr keyword SubscriptLoad AttributeLoad NameLoad attr Index Num keyword AttributeLoad NameLoad attr keyword NameLoad keyword NameLoad keyword CompareIsNot NameLoad NameLoad If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr keyword Str keyword AttributeLoad AttributeLoad NameLoad attr attr keyword AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr If CompareLt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Num AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Num Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str For TupleStore NameStore NameStore Call NameLoad AttributeLoad NameLoad attr body If CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Break Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Assign SubscriptStore AttributeLoad NameLoad attr Index Num NameLoad Assign SubscriptStore AttributeLoad NameLoad attr ExtSlice Index ListLoad Num NameLoad Slice SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index ListLoad NameLoad Num Slice decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr If CompareIsNot AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr BinOpAdd BinOpMult Call AttributeLoad AttributeLoad NameLoad attr attr BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num SubscriptLoad AttributeLoad NameLoad attr Index Num For NameStore Call NameLoad AttributeLoad NameLoad attr body If CompareGt AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Raise NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AugAssignAdd AttributeStore NameLoad attr Num If CompareLt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad NameLoad If CompareLt NameLoad SubscriptLoad AttributeLoad NameLoad attr Index Num body Assign SubscriptStore AttributeLoad NameLoad attr Index Num NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Num NameLoad Return TupleLoad AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpAdd AttributeLoad NameLoad attr BinOpMult BinOpSub NameLoad Num AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Return BinOpAdd BinOpDiv BinOpSub NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For TupleStore NameStore NameStore Call NameLoad NameLoad body If BoolOpOr CompareGt NameLoad Num CompareLt NameLoad Num body Assign SubscriptStore NameLoad Index NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Num AttributeLoad NameLoad attr If BoolOpOr CompareEq AttributeLoad NameLoad attr Str CompareEq AttributeLoad NameLoad attr Str body Assign NameStore Call AttributeLoad NameLoad attr NameLoad Call AttributeLoad NameLoad attr NameLoad Num orelse Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Num If CompareIn AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore CompareLt NameLoad AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return NameLoad orelse If CompareIn AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign NameStore Num While BoolOpAnd CompareLt NameLoad AttributeLoad NameLoad attr CompareLt Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpMod BinOpAdd NameLoad Num AttributeLoad NameLoad attr AugAssignAdd NameStore Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num Return BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult AttributeLoad NameLoad attr BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore SubscriptLoad NameLoad Slice Num Return BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index NameLoad BinOpMult AttributeLoad NameLoad attr BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad AugAssignAdd NameStore BinOpMult AttributeLoad NameLoad attr BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index Num NameLoad AugAssignAdd NameStore BinOpMult AttributeLoad NameLoad attr BinOpSub SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore NameStore SubscriptLoad NameLoad Slice Num Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index Num BinOpMult AttributeLoad NameLoad attr BinOpSub BinOpSub BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore NameStore NameStore NameLoad Assign NameStore BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index NameLoad BinOpMult AttributeLoad NameLoad attr BinOpSub BinOpSub BinOpAdd SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad Call NameLoad AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore SubscriptLoad NameLoad Slice NameLoad Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr CompareIs NameLoad NameLoad CompareIs NameLoad AttributeLoad NameLoad attr body Return AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr If Call NameLoad NameLoad TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad If Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad Raise Call NameLoad BinOpMod Str NameLoad decorator_list
N/A N/A 
differential_evolution: The differential evolution global optimization algorithm
Added by Andrew Nelson 2014
 __future__ division print_function absolute_import N/A numpy np scipy.optimize OptimizeResult minimize scipy.optimize.optimize _status_message N/A numbers N/A __all__ N/A differential_evolution N/A _MACHEPS N/A N/A N/A np finfo N/A np float64 eps differential_evolution N/A N/A func bounds args strategy maxiter popsize tol mutation recombination seed callback disp polish init N/A N/A best1bin 1000 15 0.01 N/A 0.5 1 0.7 None None False True latinhypercube N/A N/A Finds the global minimum of a multivariate function.
    Differential Evolution is stochastic in nature (does not use gradient
    methods) to find the minimium, and can search large areas of candidate
    space, but often requires larger numbers of function evaluations than
    conventional gradient based techniques.

    The algorithm is due to Storn and Price [1]_.

    Parameters
    ----------
    func : callable
        The objective function to be minimized.  Must be in the form
        ``f(x, *args)``, where ``x`` is the argument in the form of a 1-D array
        and ``args`` is a  tuple of any additional fixed parameters needed to
        completely specify the function.
    bounds : sequence
        Bounds for variables.  ``(min, max)`` pairs for each element in ``x``,
        defining the lower and upper bounds for the optimizing argument of
        `func`. It is required to have ``len(bounds) == len(x)``.
        ``len(bounds)`` is used to determine the number of parameters in ``x``.
    args : tuple, optional
        Any additional fixed parameters needed to
        completely specify the objective function.
    strategy : str, optional
        The differential evolution strategy to use. Should be one of:

            - 'best1bin'
            - 'best1exp'
            - 'rand1exp'
            - 'randtobest1exp'
            - 'best2exp'
            - 'rand2exp'
            - 'randtobest1bin'
            - 'best2bin'
            - 'rand2bin'
            - 'rand1bin'

        The default is 'best1bin'.
    maxiter : int, optional
        The maximum number of generations over which the entire population is
        evolved. The maximum number of function evaluations (with no polishing)
        is: ``(maxiter + 1) * popsize * len(x)``
    popsize : int, optional
        A multiplier for setting the total population size.  The population has
        ``popsize * len(x)`` individuals.
    tol : float, optional
        When the mean of the population energies, multiplied by tol,
        divided by the standard deviation of the population energies
        is greater than 1 the solving process terminates:
        ``convergence = mean(pop) * tol / stdev(pop) > 1``
    mutation : float or tuple(float, float), optional
        The mutation constant. In the literature this is also known as
        differential weight, being denoted by F.
        If specified as a float it should be in the range [0, 2].
        If specified as a tuple ``(min, max)`` dithering is employed. Dithering
        randomly changes the mutation constant on a generation by generation
        basis. The mutation constant for that generation is taken from
        ``U[min, max)``. Dithering can help speed convergence significantly.
        Increasing the mutation constant increases the search radius, but will
        slow down convergence.
    recombination : float, optional
        The recombination constant, should be in the range [0, 1]. In the
        literature this is also known as the crossover probability, being
        denoted by CR. Increasing this value allows a larger number of mutants
        to progress into the next generation, but at the risk of population
        stability.
    seed : int or `np.random.RandomState`, optional
        If `seed` is not specified the `np.RandomState` singleton is used.
        If `seed` is an int, a new `np.random.RandomState` instance is used,
        seeded with seed.
        If `seed` is already a `np.random.RandomState instance`, then that
        `np.random.RandomState` instance is used.
        Specify `seed` for repeatable minimizations.
    disp : bool, optional
        Display status messages
    callback : callable, `callback(xk, convergence=val)`, optional
        A function to follow the progress of the minimization. ``xk`` is
        the current value of ``x0``. ``val`` represents the fractional
        value of the population convergence.  When ``val`` is greater than one
        the function halts. If callback returns `True`, then the minimization
        is halted (any polishing is still carried out).
    polish : bool, optional
        If True (default), then `scipy.optimize.minimize` with the `L-BFGS-B`
        method is used to polish the best population member at the end, which
        can improve the minimization slightly.
    init : string, optional
        Specify how the population initialization is performed. Should be
        one of:

            - 'latinhypercube'
            - 'random'

        The default is 'latinhypercube'. Latin Hypercube sampling tries to
        maximize coverage of the available parameter space. 'random' initializes
        the population randomly - this has the drawback that clustering can
        occur, preventing the whole of parameter space being covered.

    Returns
    -------
    res : OptimizeResult
        The optimization result represented as a `OptimizeResult` object.
        Important attributes are: ``x`` the solution array, ``success`` a
        Boolean flag indicating if the optimizer exited successfully and
        ``message`` which describes the cause of the termination. See
        `OptimizeResult` for a description of other attributes.  If `polish`
        was employed, and a lower minimum was obtained by the polishing, then
        OptimizeResult also contains the ``jac`` attribute.

    Notes
    -----
    Differential evolution is a stochastic population based method that is
    useful for global optimization problems. At each pass through the population
    the algorithm mutates each candidate solution by mixing with other candidate
    solutions to create a trial candidate. There are several strategies [2]_ for
    creating trial candidates, which suit some problems more than others. The
    'best1bin' strategy is a good starting point for many systems. In this
    strategy two members of the population are randomly chosen. Their difference
    is used to mutate the best member (the `best` in `best1bin`), :math:`b_0`,
    so far:

    .. math::

        b' = b_0 + mutation * (population[rand0] - population[rand1])

    A trial vector is then constructed. Starting with a randomly chosen 'i'th
    parameter the trial is sequentially filled (in modulo) with parameters from
    `b'` or the original candidate. The choice of whether to use `b'` or the
    original candidate is made with a binomial distribution (the 'bin' in
    'best1bin') - a random number in [0, 1) is generated.  If this number is
    less than the `recombination` constant then the parameter is loaded from
    `b'`, otherwise it is loaded from the original candidate.  The final
    parameter is always loaded from `b'`.  Once the trial candidate is built
    its fitness is assessed. If the trial is better than the original candidate
    then it takes its place. If it is also better than the best overall
    candidate it also replaces that.
    To improve your chances of finding a global minimum use higher `popsize`
    values, with higher `mutation` and (dithering), but lower `recombination`
    values. This has the effect of widening the search radius, but slowing
    convergence.

    .. versionadded:: 0.15.0

    Examples
    --------
    Let us consider the problem of minimizing the Rosenbrock function. This
    function is implemented in `rosen` in `scipy.optimize`.

    >>> from scipy.optimize import rosen, differential_evolution
    >>> bounds = [(0,2), (0, 2), (0, 2), (0, 2), (0, 2)]
    >>> result = differential_evolution(rosen, bounds)
    >>> result.x, result.fun
    (array([1., 1., 1., 1., 1.]), 1.9216496320061384e-19)

    Next find the minimum of the Ackley function
    (http://en.wikipedia.org/wiki/Test_functions_for_optimization).

    >>> from scipy.optimize import differential_evolution
    >>> import numpy as np
    >>> def ackley(x):
    ...     arg1 = -0.2 * np.sqrt(0.5 * (x[0] ** 2 + x[1] ** 2))
    ...     arg2 = 0.5 * (np.cos(2. * np.pi * x[0]) + np.cos(2. * np.pi * x[1]))
    ...     return -20. * np.exp(arg1) - np.exp(arg2) + 20. + np.e
    >>> bounds = [(-5, 5), (-5, 5)]
    >>> result = differential_evolution(ackley, bounds)
    >>> result.x, result.fun
    (array([ 0.,  0.]), 4.4408920985006262e-16)

    References
    ----------
    .. [1] Storn, R and Price, K, Differential Evolution - a Simple and
           Efficient Heuristic for Global Optimization over Continuous Spaces,
           Journal of Global Optimization, 1997, 11, 341 - 359.
    .. [2] http://www1.icsi.berkeley.edu/~storn/code.html
    .. [3] http://en.wikipedia.org/wiki/Differential_evolution
     N/A solver N/A DifferentialEvolutionSolver func bounds args args strategy strategy maxiter maxiter popsize popsize tol tol mutation mutation recombination recombination seed seed polish polish callback callback disp disp init init N/A N/A N/A solver solve N/A DifferentialEvolutionSolver N/A object N/A N/A This class implements the differential evolution solver

    Parameters
    ----------
    func : callable
        The objective function to be minimized.  Must be in the form
        ``f(x, *args)``, where ``x`` is the argument in the form of a 1-D array
        and ``args`` is a  tuple of any additional fixed parameters needed to
        completely specify the function.
    bounds : sequence
        Bounds for variables.  ``(min, max)`` pairs for each element in ``x``,
        defining the lower and upper bounds for the optimizing argument of
        `func`. It is required to have ``len(bounds) == len(x)``.
        ``len(bounds)`` is used to determine the number of parameters in ``x``.
    args : tuple, optional
        Any additional fixed parameters needed to
        completely specify the objective function.
    strategy : str, optional
        The differential evolution strategy to use. Should be one of:

            - 'best1bin'
            - 'best1exp'
            - 'rand1exp'
            - 'randtobest1exp'
            - 'best2exp'
            - 'rand2exp'
            - 'randtobest1bin'
            - 'best2bin'
            - 'rand2bin'
            - 'rand1bin'

        The default is 'best1bin'

    maxiter : int, optional
        The maximum number of generations over which the entire population is
        evolved. The maximum number of function evaluations (with no polishing)
        is: ``(maxiter + 1) * popsize * len(x)``
    popsize : int, optional
        A multiplier for setting the total population size.  The population has
        ``popsize * len(x)`` individuals.
    tol : float, optional
        When the mean of the population energies, multiplied by tol,
        divided by the standard deviation of the population energies
        is greater than 1 the solving process terminates:
        ``convergence = mean(pop) * tol / stdev(pop) > 1``
    mutation : float or tuple(float, float), optional
        The mutation constant. In the literature this is also known as
        differential weight, being denoted by F.
        If specified as a float it should be in the range [0, 2].
        If specified as a tuple ``(min, max)`` dithering is employed. Dithering
        randomly changes the mutation constant on a generation by generation
        basis. The mutation constant for that generation is taken from
        U[min, max). Dithering can help speed convergence significantly.
        Increasing the mutation constant increases the search radius, but will
        slow down convergence.
    recombination : float, optional
        The recombination constant, should be in the range [0, 1]. In the
        literature this is also known as the crossover probability, being
        denoted by CR. Increasing this value allows a larger number of mutants
        to progress into the next generation, but at the risk of population
        stability.
    seed : int or `np.random.RandomState`, optional
        If `seed` is not specified the `np.random.RandomState` singleton is
        used.
        If `seed` is an int, a new `np.random.RandomState` instance is used,
        seeded with `seed`.
        If `seed` is already a `np.random.RandomState` instance, then that
        `np.random.RandomState` instance is used.
        Specify `seed` for repeatable minimizations.
    disp : bool, optional
        Display status messages
    callback : callable, `callback(xk, convergence=val)`, optional
        A function to follow the progress of the minimization. ``xk`` is
        the current value of ``x0``. ``val`` represents the fractional
        value of the population convergence.  When ``val`` is greater than one
        the function halts. If callback returns `True`, then the minimization
        is halted (any polishing is still carried out).
    polish : bool, optional
        If True, then `scipy.optimize.minimize` with the `L-BFGS-B` method
        is used to polish the best population member at the end. This requires
        a few more function evaluations.
    maxfun : int, optional
        Set the maximum number of function evaluations. However, it probably
        makes more sense to set `maxiter` instead.
    init : string, optional
        Specify which type of population initialization is performed. Should be
        one of:

            - 'latinhypercube'
            - 'random'
     N/A _binomial N/A best1bin randtobest1bin best2bin rand2bin rand1bin _best1 _randtobest1 _best2 _rand2 _rand1 N/A _exponential N/A best1exp rand1exp randtobest1exp best2exp rand2exp _best1 _rand1 _randtobest1 _best2 _rand2 __init__ N/A N/A self func bounds args strategy maxiter popsize tol mutation recombination seed maxfun callback disp polish init N/A N/A best1bin 1000 15 0.01 N/A 0.5 1 0.7 None N/A np inf None False True latinhypercube N/A N/A N/A strategy N/A self _binomial N/A N/A N/A self mutation_func N/A getattr self N/A N/A self _binomial N/A strategy N/A N/A N/A strategy N/A self _exponential N/A N/A N/A self mutation_func N/A getattr self N/A N/A self _exponential N/A strategy N/A N/A N/A ValueError Please select a valid mutation strategy N/A N/A self strategy strategy N/A N/A self callback callback N/A N/A self polish polish N/A N/A self tol tol N/A N/A self scale mutation N/A N/A N/A N/A N/A np all N/A N/A np isfinite mutation N/A N/A np any N/A N/A N/A np array mutation 2 N/A N/A np any N/A N/A N/A np array mutation 0 N/A N/A N/A ValueError The mutation constant must be a float in U[0, 2), or specified as a tuple(min, max) where min < max and min, max are in U[0, 2). N/A N/A self dither None N/A N/A N/A hasattr mutation __iter__ N/A N/A len mutation 1 N/A N/A N/A self dither N/A N/A mutation N/A 0 N/A mutation N/A 1 N/A N/A N/A N/A self dither sort N/A N/A self cross_over_probability recombination N/A N/A self func func N/A N/A self args args N/A N/A self limits N/A N/A N/A np array bounds dtype float T N/A N/A N/A N/A N/A np size N/A self limits 0 2 N/A N/A N/A np all N/A N/A np isfinite N/A self limits N/A N/A N/A ValueError bounds should be a sequence containing real valued (min, max) pairs for each value in x N/A N/A maxiter None N/A N/A maxiter 1000 N/A N/A self maxiter maxiter N/A N/A maxfun None N/A N/A maxfun N/A np inf N/A N/A self maxfun maxfun N/A N/A self __scale_arg1 N/A 0.5 N/A N/A N/A self limits N/A 0 N/A N/A self limits N/A 1 N/A N/A self __scale_arg2 N/A N/A np fabs N/A N/A N/A self limits N/A 0 N/A N/A self limits N/A 1 N/A N/A self parameter_count N/A N/A np size N/A self limits 1 N/A N/A self random_number_generator N/A _make_random_gen seed N/A N/A self num_population_members N/A popsize N/A self parameter_count N/A N/A self population_shape N/A N/A self num_population_members N/A self parameter_count N/A N/A self _nfev 0 N/A N/A init latinhypercube N/A N/A N/A N/A self init_population_lhs N/A N/A N/A init random N/A N/A N/A N/A self init_population_random N/A N/A N/A ValueError The population initialization method must be oneof 'latinhypercube' or 'random' N/A N/A self disp disp N/A init_population_lhs N/A N/A self N/A N/A N/A 
        Initializes the population with Latin Hypercube Sampling.
        Latin Hypercube Sampling ensures that each parameter is uniformly
        sampled over its range.
         N/A rng N/A self random_number_generator N/A segsize N/A 1.0 N/A self num_population_members N/A samples N/A N/A segsize N/A N/A rng random_sample N/A self population_shape N/A N/A N/A np linspace 0.0 1.0 N/A self num_population_members endpoint False N/A N/A N/A N/A np newaxis N/A N/A self population N/A N/A np zeros_like samples N/A j N/A range N/A self parameter_count N/A N/A order N/A N/A rng permutation N/A range N/A self num_population_members N/A N/A N/A self population N/A N/A N/A j N/A samples N/A N/A order j N/A N/A self population_energies N/A N/A N/A np ones N/A self num_population_members N/A np inf N/A N/A self _nfev 0 N/A init_population_random N/A N/A self N/A N/A N/A 
        Initialises the population at random.  This type of initialization
        can possess clustering, Latin Hypercube sampling is generally better.
         N/A rng N/A self random_number_generator N/A N/A self population N/A N/A rng random_sample N/A self population_shape N/A N/A self population_energies N/A N/A N/A np ones N/A self num_population_members N/A np inf N/A N/A self _nfev 0 N/A x N/A N/A self N/A N/A N/A 
        The best solution from the solver

        Returns
        -------
        x : ndarray
            The best solution from the solver.
         N/A N/A N/A self _scale_parameters N/A N/A self population N/A 0 N/A property convergence N/A N/A self N/A N/A N/A 
        The standard deviation of the population energies divided by their
        mean.
         N/A N/A N/A N/A np std N/A self population_energies N/A N/A np abs N/A N/A N/A np mean N/A self population_energies _MACHEPS N/A property solve N/A N/A self N/A N/A N/A 
        Runs the DifferentialEvolutionSolver.

        Returns
        -------
        res : OptimizeResult
            The optimization result represented as a ``OptimizeResult`` object.
            Important attributes are: ``x`` the solution array, ``success`` a
            Boolean flag indicating if the optimizer exited successfully and
            ``message`` which describes the cause of the termination. See
            `OptimizeResult` for a description of other attributes.  If `polish`
            was employed, and a lower minimum was obtained by the polishing,
            then OptimizeResult also contains the ``jac`` attribute.
         N/A N/A nit warning_flag N/A 0 False N/A status_message N/A _status_message N/A success N/A N/A N/A np all N/A N/A np isinf N/A self population_energies N/A N/A N/A N/A self _calculate_population_energies N/A nit N/A range 1 N/A N/A self maxiter 1 N/A N/A N/A N/A N/A next self N/A N/A N/A StopIteration N/A N/A warning_flag True N/A status_message N/A _status_message N/A maxfev N/A N/A N/A self disp N/A N/A N/A print N/A differential_evolution step %d: f(x)= %g N/A nit N/A N/A self population_energies N/A 0 N/A convergence N/A self convergence N/A N/A N/A self callback N/A N/A N/A self callback N/A N/A self _scale_parameters N/A N/A self population N/A 0 convergence N/A N/A self tol convergence True N/A N/A warning_flag True N/A status_message callback function requested stop early by returning True N/A N/A N/A N/A convergence N/A self tol warning_flag N/A N/A N/A N/A status_message N/A _status_message N/A maxiter N/A warning_flag True N/A DE_result N/A OptimizeResult x N/A self x fun N/A N/A self population_energies N/A 0 nfev N/A self _nfev nit nit message status_message success N/A warning_flag True N/A N/A self polish N/A N/A result N/A minimize N/A self func N/A N/A np copy N/A DE_result x method L-BFGS-B bounds N/A N/A self limits T args N/A self args N/A N/A self _nfev N/A result nfev N/A N/A DE_result nfev N/A self _nfev N/A N/A N/A result fun N/A DE_result fun N/A N/A N/A DE_result fun N/A result fun N/A N/A DE_result x N/A result x N/A N/A DE_result jac N/A result jac N/A N/A N/A self population_energies N/A 0 N/A result fun N/A N/A N/A self population N/A 0 N/A N/A self _unscale_parameters N/A result x N/A DE_result N/A _calculate_population_energies N/A N/A self N/A N/A N/A 
        Calculate the energies of all the population members at the same time.
        Puts the best member in first place. Useful if the population has just
        been initialised.
         N/A N/A index candidate N/A enumerate N/A self population N/A N/A N/A N/A self _nfev N/A self maxfun N/A N/A N/A parameters N/A N/A self _scale_parameters candidate N/A N/A N/A self population_energies N/A index N/A N/A self func parameters N/A self args N/A N/A self _nfev 1 N/A minval N/A N/A np argmin N/A self population_energies N/A lowest_energy N/A N/A self population_energies N/A minval N/A N/A N/A self population_energies N/A minval N/A N/A self population_energies N/A 0 N/A N/A N/A self population_energies N/A 0 lowest_energy N/A N/A N/A self population N/A N/A N/A 0 minval N/A N/A N/A self population N/A N/A N/A minval 0 N/A N/A __iter__ N/A N/A self N/A N/A N/A self N/A __next__ N/A N/A self N/A N/A N/A 
        Evolve the population by a single generation

        Returns
        -------
        x : ndarray
            The best solution from the solver.
        fun : float
            Value of objective function obtained from the best solution.
         N/A N/A N/A np all N/A N/A np isinf N/A self population_energies N/A N/A N/A N/A self _calculate_population_energies N/A N/A N/A self dither None N/A N/A N/A self scale N/A N/A N/A N/A N/A self random_number_generator rand N/A N/A N/A self dither N/A 1 N/A N/A self dither N/A 0 N/A N/A self dither N/A 0 N/A candidate N/A range N/A self num_population_members N/A N/A N/A N/A self _nfev N/A self maxfun N/A N/A StopIteration N/A trial N/A N/A self _mutate candidate N/A N/A N/A self _ensure_constraint trial N/A parameters N/A N/A self _scale_parameters trial N/A energy N/A N/A self func parameters N/A self args N/A N/A self _nfev 1 N/A N/A energy N/A N/A self population_energies N/A candidate N/A N/A N/A N/A self population N/A candidate trial N/A N/A N/A self population_energies N/A candidate energy N/A N/A energy N/A N/A self population_energies N/A 0 N/A N/A N/A N/A self population_energies N/A 0 energy N/A N/A N/A self population N/A 0 trial N/A N/A N/A self x N/A N/A self population_energies N/A 0 N/A next N/A N/A self N/A N/A N/A 
        Evolve the population by a single generation

        Returns
        -------
        x : ndarray
            The best solution from the solver.
        fun : float
            Value of objective function obtained from the best solution.
         N/A N/A N/A self __next__ N/A _scale_parameters N/A N/A self trial N/A N/A N/A 
        scale from a number between 0 and 1 to parameters.
         N/A N/A N/A self __scale_arg1 N/A N/A trial 0.5 N/A self __scale_arg2 N/A _unscale_parameters N/A N/A self parameters N/A N/A N/A 
        scale from parameters to a number between 0 and 1.
         N/A N/A N/A N/A parameters N/A self __scale_arg1 N/A self __scale_arg2 0.5 N/A _ensure_constraint N/A N/A self trial N/A N/A N/A 
        make sure the parameters lie between the limits
         N/A N/A index param N/A enumerate trial N/A N/A N/A N/A param 1 N/A param 0 N/A N/A N/A trial N/A index N/A N/A N/A self random_number_generator rand N/A _mutate N/A N/A self candidate N/A N/A N/A 
        create a trial vector based on a mutation strategy
         N/A trial N/A N/A np copy N/A N/A self population N/A candidate N/A rng N/A self random_number_generator N/A fill_point N/A N/A rng randint 0 N/A self parameter_count N/A N/A N/A N/A self strategy randtobest1exp N/A N/A self strategy randtobest1bin N/A N/A bprime N/A N/A self mutation_func candidate N/A N/A self _select_samples candidate 5 N/A N/A bprime N/A N/A self mutation_func N/A N/A self _select_samples candidate 5 N/A N/A N/A self strategy N/A self _binomial N/A N/A crossovers N/A N/A rng rand N/A self parameter_count N/A crossovers N/A crossovers N/A self cross_over_probability N/A N/A crossovers N/A fill_point True N/A trial N/A N/A np where crossovers bprime trial N/A trial N/A N/A N/A N/A self strategy N/A self _exponential N/A N/A i 0 N/A N/A N/A i N/A self parameter_count N/A N/A N/A rng rand N/A self cross_over_probability N/A N/A N/A trial N/A fill_point N/A bprime N/A fill_point N/A fill_point N/A N/A fill_point 1 N/A self parameter_count N/A i 1 N/A trial N/A _best1 N/A N/A self samples N/A N/A N/A 
        best1bin, best1exp
         N/A N/A r0 r1 N/A samples N/A 2 N/A N/A N/A N/A self population N/A 0 N/A N/A self scale N/A N/A N/A self population N/A r0 N/A N/A self population N/A r1 N/A _rand1 N/A N/A self samples N/A N/A N/A 
        rand1bin, rand1exp
         N/A N/A r0 r1 r2 N/A samples N/A 3 N/A N/A N/A N/A self population N/A r0 N/A N/A self scale N/A N/A N/A self population N/A r1 N/A N/A self population N/A r2 N/A _randtobest1 N/A N/A self candidate samples N/A N/A N/A 
        randtobest1bin, randtobest1exp
         N/A N/A r0 r1 N/A samples N/A 2 N/A bprime N/A N/A np copy N/A N/A self population N/A candidate N/A bprime N/A N/A self scale N/A N/A N/A self population N/A 0 bprime N/A bprime N/A N/A self scale N/A N/A N/A self population N/A r0 N/A N/A self population N/A r1 N/A bprime N/A _best2 N/A N/A self samples N/A N/A N/A 
        best2bin, best2exp
         N/A N/A r0 r1 r2 r3 N/A samples N/A 4 N/A bprime N/A N/A N/A self population N/A 0 N/A N/A self scale N/A N/A N/A N/A N/A self population N/A r0 N/A N/A self population N/A r1 N/A N/A self population N/A r2 N/A N/A self population N/A r3 N/A bprime N/A _rand2 N/A N/A self samples N/A N/A N/A 
        rand2bin, rand2exp
         N/A N/A r0 r1 r2 r3 r4 samples N/A bprime N/A N/A N/A self population N/A r0 N/A N/A self scale N/A N/A N/A N/A N/A self population N/A r1 N/A N/A self population N/A r2 N/A N/A self population N/A r3 N/A N/A self population N/A r4 N/A bprime N/A _select_samples N/A N/A self candidate number_samples N/A N/A N/A 
        obtain random integers from range(self.num_population_members),
        without replacement.  You can't have the original candidate either.
         N/A idxs N/A list N/A range N/A self num_population_members N/A N/A N/A idxs remove candidate N/A N/A N/A N/A self random_number_generator shuffle idxs N/A idxs N/A idxs N/A number_samples N/A idxs N/A N/A _make_random_gen N/A N/A seed N/A N/A N/A Turn seed into a np.random.RandomState instance

    If seed is None, return the RandomState singleton used by np.random.
    If seed is an int, return a new RandomState instance seeded with seed.
    If seed is already a RandomState instance, return it.
    Otherwise raise ValueError.
     N/A N/A N/A seed None N/A seed N/A np random N/A N/A N/A N/A N/A np random mtrand _rand N/A N/A isinstance seed N/A N/A numbers Integral N/A np integer N/A N/A N/A N/A N/A np random RandomState seed N/A N/A isinstance seed N/A N/A np random RandomState N/A N/A seed N/A N/A ValueError N/A %r cannot be used to seed a numpy.random.RandomState instance seed N/A