josiann.sa
- josiann.sa(fun, x0, args=None, bounds=None, moves=((0.8, [Move] RandomStep(0.05)), (0.2, [Move] RandomStep(0.5))), nb_walkers=1, max_iter=200, max_measures=20, alpha=0.95, epsilon=0.01, T_0=5.0, tol=0.001, backup=False, seed=None, verbose=True, suppress_warnings=False, detect_convergence=True, window_size=None, dtype=<class 'numpy.float64'>)[source]
Simulated Annealing algorithm.
- Parameters:
fun (
Callable[...,float]) – a <d> dimensional (noisy) function to minimize.x0 (
ndarray[tuple[int,...],dtype[Any]]) – a <d> dimensional vector of initial values.args (
Optional[tuple[Any,...]] (default:None)) – an optional sequence of arguments to pass to the function to minimize.bounds (
Optional[Sequence[tuple[float,float]]] (default:None)) – an optional sequence of bounds (one for each <n> dimensions) with the following format: (lower_bound, upper_bound) or a single (lower_bound, upper_bound) tuple of bounds to set for all dimensions.moves (
Move|Sequence[Move] |Sequence[tuple[float,Move]] (default:((0.8, [Move] RandomStep(0.05)), (0.2, [Move] RandomStep(0.5))))) –a single josiann.Move object
- a sequence of josiann.Move objects (all Moves have the same probability of being selected at each step
for proposing a new candidate vector x)
- a sequence of tuples with the following format :
(selection probability, josiann.Move) In this case, the selection probability dictates the probability of each Move of being selected at each step.
nb_walkers (
int(default:1)) – the number of parallel walkers in the ensemble.max_iter (
int(default:200)) – the maximum number of iterations before stopping the algorithm.max_measures (
int(default:20)) – the maximum number of function evaluations to average per step.alpha (
float(default:0.95)) – cooling coefficient,epsilon (
float(default:0.01)) – parameter in (0, 1) for controlling the rate of standard deviation decrease (bigger values yield steeper descent profiles)T_0 (
float(default:5.0)) – initial temperature value.tol (
float(default:0.001)) – the convergence tolerance.backup (
bool(default:False)) – use Backup for storing previously computed function evaluations and reusing them when returning to the same position vector ? (Only available when using SetStep moves).seed (
Optional[int] (default:None)) – a seed for the random generator.verbose (
bool(default:True)) – print progress bar ?suppress_warnings (
bool(default:False)) – remove warnings ?detect_convergence (
bool(default:True)) – run convergence detection for an early stop of the algorithm ?window_size (
Optional[int] (default:None)) – number of past iterations to look at for detecting the convergence, getting the best position and computing the acceptance fraction.dtype (
float64|int64(default:<class 'numpy.float64'>)) – the data type for the values stored in the Trace.
- Return type:
- Returns:
A Result object.