CoOperative co-Evolutionary Algorithm (COEA)¶
- class pypop7.optimizers.cc.coea.COEA(problem, options)¶
CoOperative co-Evolutionary Algorithm (COEA).
Note
This is a slightly modified version of COEA, where the more common real-valued representation is used for continuous optimization rather than binary-coding used in the original paper. For the suboptimizer, the GENITOR is used, owing to its simplicity.
- 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 setting (key):
’n_individuals’ - number of individuals/samples, aka population size (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.cc.coea import COEA 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>>> coea = COEA(problem, options) # initialize the optimizer class 12>>> results = coea.optimize() # run the optimization process 13>>> # return the number of function evaluations and best-so-far fitness 14>>> print(f"COEA: {results['n_function_evaluations']}, {results['best_so_far_y']}") 15COEA: 5000, 0.43081941641866195
For its correctness checking of coding, refer to this code-based repeatability report for more details.
- n_individuals¶
number of individuals/samples, aka population size.
- Type:
int
References
Potter, M.A. and De Jong, K.A., 2000. Cooperative coevolution: An architecture for evolving coadapted subcomponents. Evolutionary Computation, 8(1), pp.1-29. https://direct.mit.edu/evco/article/8/1/1/859/Cooperative-Coevolution-An-Architecture-for
Potter, M.A. and De Jong, K.A., 1994, October. A cooperative coevolutionary approach to function optimization. In International Conference on Parallel Problem Solving from Nature (pp. 249-257). Springer, Berlin, Heidelberg. https://link.springer.com/chapter/10.1007/3-540-58484-6_269