optimization.optimizer.scipy.basin_hopping

Classes

BasinHopping(problem)

Basin-hopping optimizer for solving optimization problems.

class BasinHopping(problem: OptimizationProblem)[source]

Basin-hopping optimizer for solving optimization problems.

Parameters:

problem (OptimizationProblem) – The optimization problem to be solved.

optimize(maxiter=1000, disp=True, workers=-1)[source]

Runs the basin-hopping optimization algorithm.

optimize(niter: int = 100, plot: bool = False, callback: Any = None, *args, **kwargs)[source]

Runs the basin-hopping algorithm. Note that the basin-hopping algorithm accepts the same arguments as the scipy.optimize.basinhopping function.

Parameters:
  • niter (int) – Number of iterations to perform. Default is 100.

  • plot – If True, update live plots during optimization.

  • callback (callable) – A callable called after each iteration.

  • *args – Variable length argument list.

  • **kwargs – Arbitrary keyword arguments.

Returns:

The optimization result.

Return type:

result (OptimizeResult)

Raises:

ValueError – If any variable in the problem does not have bounds.

undo()

Undo the last optimization step.