# CoOperative CO-evolutionary Covariance Matrix Adaptation (COCMA)¶

class pypop7.optimizers.cc.cocma.COCMA(problem, options)

CoOperative CO-evolutionary Covariance Matrix Adaptation (COCMA).

Note

For COCMA, CMA-ES is used as the suboptimizer, since it could learn the variable dependencies in each subsapce to accelerate convergence. The simplest cyclic decomposition is employed to tackle non-separable objective functions, argurably a common feature of most real-world applications.

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).

• ’sigma’ - initial global step-size (float, default: problem[‘upper_boundary’] - problem[‘lower_boundary’]/3.0),

• ’ndim_subproblem’ - dimensionality of subproblem for decomposition (int, default: 30).

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.cocma import COCMA
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>>> cocma = COCMA(problem, options)  # initialize the optimizer class
12>>> results = cocma.optimize()  # run the optimization process
13>>> # return the number of function evaluations and best-so-far fitness
14>>> print(f"COCMA: {results['n_function_evaluations']}, {results['best_so_far_y']}")
15COCMA: 5000, 5.610179991025547e-09
```

For its correctness checking of coding, we cannot provide the code-based repeatability report, since this implementation combines different papers. To our knowledge, few well-designed open-source code of CC is available for non-separable black-box optimization.

n_individuals

number of individuals/samples, aka population size.

Type:

int

sigma

initial global step-size.

Type:

float

ndim_subproblem

dimensionality of subproblem for decomposition.

Type:

int

References

Mei, Y., Omidvar, M.N., Li, X. and Yao, X., 2016. A competitive divide-and-conquer algorithm for unconstrained large-scale black-box optimization. ACM Transactions on Mathematical Software, 42(2), pp.1-24. https://dl.acm.org/doi/10.1145/2791291

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