Scipy_DualAnnealing
- class sherpa.optmethods.optscipy.Scipy_DualAnnealing(name: str | None = None, **kwargs)[source] [edit on github]
Bases:
ScipyBaseOptimizer using
scipy.optimize.dual_annealing.See the
scipy.optimize.dual_annealingdocumentation for details of all parameters. Sherpa will automatically convert statistics functions, input values, parameter limits etc. to the format required by the scipy function. The following attributes can be set as attributes of this class.- Attributes:
- maxiter
int The maximum number of iterations.
- minimizer_kwargs
dict A dictionary of options to pass to the local minimizer.
- initial_temp
float A higher value allows dual_annealing to escape local minima that it is trapped in.
- restart_temp_ratio
float During the annealing process, temperature is decreasing, when it reaches initial_temp * restart_temp_ratio, the reannealing process is triggered. Default value of the ratio is 2e-5. Range is (0, 1).
- visit
float Parameter for visiting distribution. Default value is 2.62. Higher values allow jumps to more distant regions. The value range is (1, 3].
- accept
float Control for the acceptance probability. Default value is -5.0 with a range (-1e4, -5].
- maxfun
int Soft limit for the number of objective function calls. Default value is 1e7.
- rng{
None,int,numpy.random.Generator} Random number generator instance or seed.
- no_local_searchbool
If True, the local search is not performed.
- callback
callable() A callable called after each iteration.
- maxiter
Methods
fit(statfunc, pars, parmins, parmaxes[, ...])Run the optimiser.
Attributes Summary
The default settings for the optimiser.
Methods Summary
fit(statfunc, pars, parmins, parmaxes[, ...])Run the optimiser.
Attributes Documentation
- default_config
The default settings for the optimiser.
Methods Documentation
- fit(statfunc: Callable[[Sequence[float] | ndarray], tuple[float, ndarray]], pars: Sequence[float] | ndarray, parmins: Sequence[float] | ndarray, parmaxes: Sequence[float] | ndarray, statargs: Any = None, statkwargs: Any = None) tuple[bool, ndarray, float, str, dict[str, Any]] [edit on github]
Run the optimiser.
Changed in version 4.18.0: The statargs and statkwargs arguments are now ignored.
Changed in version 4.16.0: The statkwargs argument now defaults to None rather than {}.
- Parameters:
- statfunc
function Given a list of parameter values as the first argument and, as the remaining positional arguments,
statargsandstatkwargsas keyword arguments, return the statistic value.- parssequence
The start position of the model parameter values.
- parminssequence
The minimum allowed values for each model parameter. This must match the length of
pars.- parmaxessequence
The maximum allowed values for each model parameter. This must match the length of
pars.- statargs
optional This is currently unused.
- statkwargs
dict,optional This is currently unused.
- statfunc
- Returns:
- newpars
tuple The tuple contains: boolean indicating whether the optimization succeeded or not, the best fit parameters as a NumPy array, the statistic value at the best-fit location, a string message indicating the status, and a dictionary containing information about the optimisation (this depends on the optimiser).
- newpars