Powell’s search method (POWELL)¶
- class pypop7.optimizers.ds.powell.POWELL(problem, options)¶
Powell’s search method (POWELL).
Note
This is a wrapper of the Powell algorithm from SciPy with accuracy control of maximum of function evaluations.
- 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):
’x’ - initial (starting) point (array_like),
if not given, it will draw a random sample from the uniform distribution whose search range is bounded by problem[‘lower_boundary’] and problem[‘upper_boundary’].
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.ds.powell import POWELL 4>>> problem = {'fitness_function': rosenbrock, # define problem arguments 5... 'ndim_problem': 20, 6... 'lower_boundary': -5*numpy.ones((20,)), 7... 'upper_boundary': 5*numpy.ones((20,))} 8>>> options = {'max_function_evaluations': 5000, # set optimizer options 9... 'seed_rng': 2022, 10... 'x': 3*numpy.ones((20,)), 11... 'verbose_frequency': 500} 12>>> powell = POWELL(problem, options) # initialize the optimizer class 13>>> results = powell.optimize() # run the optimization process 14>>> # return the number of function evaluations and best-so-far fitness 15>>> print(f"POWELL: {results['n_function_evaluations']}, {results['best_so_far_y']}") 16POWELL: 50000, 0.0
For its correctness checking of coding, refer to this code-based repeatability report for more details.
- x¶
initial (starting) point.
- Type:
array_like
References
https://docs.scipy.org/doc/scipy/reference/optimize.minimize-powell.html
Kochenderfer, M.J. and Wheeler, T.A., 2019. Algorithms for optimization. MIT Press. https://algorithmsbook.com/optimization/files/chapter-7.pdf (See Algorithm 7.3 (Page 102) for details.)
Powell, M.J., 1964. An efficient method for finding the minimum of a function of several variables without calculating derivatives. The Computer Journal, 7(2), pp.155-162. https://academic.oup.com/comjnl/article-abstract/7/2/155/335330