pybop.optimisers.scipy_optimisers#

Classes#

SciPyDifferentialEvolution

Adapter for SciPy's differential_evolution function for global optimisation, useful for problems

SciPyMinimize

Adapter for various scalar minimisation algorithms implemented in SciPy, allowing fine-tuning

Module Contents#

class pybop.optimisers.scipy_optimisers.SciPyDifferentialEvolution(problem: pybop.problems.problem.Problem, options: SciPyDifferentialEvolutionOptions | None = None)[source]#

Bases: BaseSciPyOptimiser

Adapter for SciPy’s differential_evolution function for global optimisation, useful for problems involving continuous parameters and potentially multiple local minima.

Parameters:

See also

scipy.optimize.differential_evolution

The SciPy method this class is based on.

Notes

Differential Evolution is a stochastic population based method that is useful for global optimisation problems. At each pass through the population the algorithm mutates each candidate solution by mixing with other candidate solutions to create a trial candidate. The fitness of all candidates is then evaluated and for each candidate if the trial candidate is an improvement, it takes its place in the population for the next iteration.

_run()[source]#

Executes the optimisation process using SciPy’s differential_evolution function.

Returns:

result – The result of the optimisation including the optimised parameter values and cost.

Return type:

scipy.optimize.OptimizeResult

_set_up_optimiser()[source]#

Parse optimiser options.

static default_options() SciPyDifferentialEvolutionOptions[source]#

Returns the default options for the optimiser.

property name#

Provides the name of the optimisation strategy.

class pybop.optimisers.scipy_optimisers.SciPyMinimize(problem: pybop.problems.problem.Problem, options: SciPyMinimizeOptions | None = None)[source]#

Bases: BaseSciPyOptimiser

Adapter for various scalar minimisation algorithms implemented in SciPy, allowing fine-tuning of the optimisation process through method selection and option configuration.

Parameters:
  • problem (pybop.Problem) – The problem to optimise.

  • options (ScipyMinizeOptions, optional) – Options for the SciPy minimize method (default: None).

See also

scipy.optimize.minimize

The SciPy method this class is based on.

Notes

Different optimisation methods may support different options. Consult SciPy’s documentation for method-specific options and constraints.

_run()[source]#

Executes the optimisation process using SciPy’s minimize function.

Returns:

result – The result of the optimisation including the optimised parameter values and cost.

Return type:

scipy.optimize.OptimizeResult

_set_up_optimiser()[source]#

Parse optimiser options.

cost_wrapper(x)[source]#

Scale the cost function, preserving the sign, and eliminate nan values.

static default_options() SciPyMinimizeOptions[source]#

Returns the default options for the optimiser.

property name#

Provides the name of the optimisation strategy.