Enhanced Simulated Annealing (ESA)¶
- class pypop7.optimizers.sa.esa.ESA(problem, options)¶
Enhanced Simulated Annealing (ESA).
Note
ESA adopts a random decomposition strategy to alleviate the curse of dimensionality for large-scale black-box optimization. Note that it shares some similaries (i.e., axis-parallel decomposition) to the Cooperative Coevolution framework, which uses population-based sampling (rather than individual-based sampling of ESA) for each subproblem (corresponding to a search subspace).
- Parameters:
problem (dict) –
- problem arguments with the following common settings (keys):
’fitness_function’ - objective function to be minimized (func),
’ndim_problem’ - number of dimensionality (int),
’upper_boundary’ - upper boundary of search range (array_like),
’lower_boundary’ - lower boundary of search range (array_like).
options (dict) –
- optimizer options with the following common settings (keys):
’max_function_evaluations’ - maximum of function evaluations (int, default: np.Inf),
’max_runtime’ - maximal runtime to be allowed (float, default: np.Inf),
’seed_rng’ - seed for random number generation needed to be explicitly set (int);
- and with the following particular settings (keys):
’p’ - subspace dimension (int, default: int(np.ceil(problem[‘ndim_problem’]/3))),
’n1’ - factor to control temperature stage w.r.t. accepted moves (int, default: 12),
’n2’ - factor to control temperature stage w.r.t. attempted moves (int, default: 100).
Examples
Use the optimizer to minimize the well-known test function Rosenbrock:
1>>> import numpy 2>>> from pypop7.benchmarks.base_functions import rosenbrock # function to be minimized 3>>> from pypop7.optimizers.sa.esa import ESA 4>>> problem = {'fitness_function': rosenbrock, # define problem arguments 5... 'ndim_problem': 2, 6... 'lower_boundary': -5*numpy.ones((2,)), 7... 'upper_boundary': 5*numpy.ones((2,))} 8>>> options = {'max_function_evaluations': 5000, # set optimizer options 9... 'seed_rng': 2022, 10... 'x': 3*numpy.ones((2,))} 11>>> esa = ESA(problem, options) # initialize the optimizer class 12>>> results = esa.optimize() # run the optimization process 13>>> # return the number of function evaluations and best-so-far fitness 14>>> print(f"ESA: {results['n_function_evaluations']}, {results['best_so_far_y']}") 15ESA: 5000, 6.481109148014023
For its correctness checking of coding, refer to this code-based repeatability report for more details.
- n1¶
factor to control temperature stage w.r.t. accepted moves.
- Type:
int
- n2¶
factor to control temperature stage w.r.t. attempted moves.
- Type:
int
- p¶
subspace dimension.
- Type:
int
References
Siarry, P., Berthiau, G., Durdin, F. and Haussy, J., 1997. Enhanced simulated annealing for globally minimizing functions of many-continuous variables. ACM Transactions on Mathematical Software, 23(2), pp.209-228. https://dl.acm.org/doi/abs/10.1145/264029.264043