pybop.optimisers._simulated_annealing#

Classes#

SimulatedAnnealingImpl

Simulated Annealing optimiser, implementing the classic temperature-based

Module Contents#

class pybop.optimisers._simulated_annealing.SimulatedAnnealingImpl(x0: numpy.ndarray, sigma0: list[float] | None, boundaries: pints.Boundaries | None)[source]#

Bases: pints.Optimiser

Simulated Annealing optimiser, implementing the classic temperature-based probabilistic optimisation method.

This method uses a temperature schedule to control the probability of accepting worse solutions as it explores the parameter space. As the temperature decreases, the algorithm becomes more selective, eventually converging to a local or global optimum.

The probability of accepting a worse solution is given by:

.. math::

P(accept) = exp(-(f_{ ext{new}} - fold)/T)

The temperature decreases according to the cooling schedule:

.. math::

T = T0 * lpha^k

where: - :math: T0 is the initial temperature - :math: lpha is the cooling rate (between 0 and 1) - :math: k is the iteration number

Parameters:
  • x0 (numpy array) – Initial position

  • sigma0 (float) – Initial step size

  • boundaries (dict, optional) – Optional boundaries for parameters

ask()[source]#

Returns a list of next points in the parameter-space to evaluate from the optimiser.

f_best()[source]#

Returns the best score found.

n_hyper_parameters()[source]#

Returns the number of hyper-parameters for this optimiser.

name()[source]#

Returns the name of this optimiser.

needs_sensitivities()[source]#

Returns whether this method needs sensitivities.

running()[source]#

Returns whether the optimisation is still running.

tell(reply)[source]#

Receives a list of function values from the cost function from points previously specified by self.ask(), and updates the optimiser state accordingly.

x_best()[source]#

Returns the best position found.

_current[source]#
_current_f[source]#
_f_best[source]#
_iterations = 0[source]#
_proposed[source]#
_ready_for_tell = False[source]#
_running = False[source]#
_temperature = 1.0[source]#
_temperature_decay = 0.95[source]#
_x_best[source]#
property cooling_rate[source]#
property temperature[source]#