module documentation

This module contains the implementation of the Multiobjective framework called Sofomore, and its instantiation with cma-es to obtain COMO-CMA-ES, defined in the paper [Toure, Cheikh, et al. "Uncrowded Hypervolume Improvement: COMO-CMA-ES and the Sofomore framework." GECCO'19-Genetic and Evolutionary Computation Conference. 2019.].

Only the bi-objective framework is functional and has been thoroughly tested.

Class CmaKernel inheriting from the cma.CMAEvolutionStrategy class, by adding the property incumbent, the attributes objective_values and _last_offspring_f_values.
Class FitFun Define a callable multiobjective function from single objective ones. Example:
Class GetKernelIPOP non-adaptive IPOP incrementing scheme.
Class GetKernelPopsizeIncrementer a callable that returns the result of a call of get_kernel.
Class IndicatorFront with hypervolume_improvement method based on a varying empirical front.
Class RampUpSelector Takes a list of ramp-up methods and a selection "criterion",
Class Sofomore Sofomore framework for multiobjective optimization, with the ask-and-tell interface.
Function best_chv_restart_kernel create a kernel (solver) of TYPE CmaKernel by duplicating the kernel with best uncrowded hypervolume improvement.
Function cma_kernel_default_options_dynamic_tolx return factor times minimum tolx from non-dominated kernels.
Function get_cmas Factory function that produces len(x_starts) instances of type cmaKernel.
Function get_kernel_best_chv_restart return a list with one element of type CmaKernel.
Function get_kernel_random_restart return a list with one element of type CmaKernel.
Function random_restart_kernel create a kernel (solver) of TYPE CmaKernel with a random initial mean, or an initial mean given by the factory function x0_funct, and initial step-size sigma0.
Function sort_decreasing Example:
Function sort_even_odds Example:
Function sort_increasing Example:
Function sort_odds_even Example:
Function sort_random Used for the update order of a Sofomore instance. Example:
Variable __author__ Undocumented
Variable __license__ Undocumented
Variable __version__ Undocumented
Variable cma_kernel_default_options_replacements Undocumented
Class _CounterDict A dictionary with two additional features.
def best_chv_restart_kernel(moes, sigma_factor=1, **kwargs):

create a kernel (solver) of TYPE CmaKernel by duplicating the kernel with best uncrowded hypervolume improvement.

Parameters

moes : TYPE Sofomore
A multiobjective solver instance with cma-es (of TYPE CmaKernel) solvers.
sigma_factor : TYPE int or float, optional
A step size factor used in the initial step-size of the kernel returned. The default is 1.
**kwargs :
Other keyword arguments.

Returns

A kernel (solver) of TYPE CmaKernel derived from the kernel with largest contributing HV.

def cma_kernel_default_options_dynamic_tolx(moes, factor=0.1):

return factor times minimum tolx from non-dominated kernels.

Fallback to default tolx if the pareto_front_cut is empty.

def get_cmas(x_starts, sigma_starts, inopts=None, number_created_kernels=0):

Factory function that produces len(x_starts) instances of type cmaKernel.

Parameters

x_starts : TYPE list or list of lists or list of or ndarrays or ndarray
The initial means of the returned cmas.
sigma_starts : TYPE float or list of floats
The initial step-sizes of the returned cmas.
inopts : TYPE dict or list of dicts, optional
The cmas' options.
number_created_kernels : TYPE int, optional
Used as the starting index for the returned cma's names. The values of the options' key 'verb_filenameprefix' rely upon this argument number_created_kernels.

Returns

A list of CmaKernel instances.

Example:

>>> import comocma
>>> dimension = 10
>>> sigma0 = 0.5
>>> num_kernels = 11
>>> cma_opts = {'tolx': 10**-4, 'popsize': 32}
>>> list_of_solvers = comocma.get_cmas(num_kernels * [dimension * [0]], sigma0, cma_opts)
produce num_kernels cma instances.
def get_kernel_best_chv_restart(moes, opts=(), dynamic_tolx=cma_kernel_default_options_dynamic_tolx, sigma_factor=1, **kwargs):

return a list with one element of type CmaKernel.

Parameters

moes: Sofomore, the instance for which this method is used as restart option.

opts: dict, options passed (possibly with modifications) to CmaKernel(cma.CMAEvolutionStrategy).

dynamic_tolx: Callable[[Sofomore, [factor]] -> tolx: float, initialize the tolx option of CmaKernel depending on the kernels of a Sofomore instance.

kwargs: dict, unused keyword arguments to allow for a generic call of Sofomore.restart.

Details: this function picks best boundary kernels only with probability of about 2 / number_of_kernels and uses cma_kernel_default_options_dynamic_tolx to control the tolx option of CmaKernel.

TODO: it may be better to pick best boundary kernels with at least, say, 5%. However from a practical perspective, boundary kernels are usually of lesser interest and pushing the boundary leads to more gaps at extremer (less interesting) regions(?) that will also be filled in the sequel.

def get_kernel_random_restart(moes, x0_fct=None, opts=(), tolx_factor=0.05, dynamic_tolx=cma_kernel_default_options_dynamic_tolx, **kwargs):

return a list with one element of type CmaKernel.

Parameters

moes: Sofomore, the instance for which this method is used as restart option.

x0_fct: callable, that returns an initial solution passed to CmaKernel. By default uniform in [-5, 5].

opts: dict, options passed (possibly with modifications) to the CmaKernel(cma.CMAEvolutionStrategy) instantiation call.

dynamic_tolx: Callable[[Sofomore, [factor]] -> tolx: float, initialize the tolx option of CmaKernel depending on the kernels of a Sofomore instance.

kwargs: dict, unused keyword arguments to allow for a generic call of Sofomore.restart.

Details: this function mimics random_restart_kernel but uses additionally cma_kernel_default_options_dynamic_tolx to control the tolx option of CmaKernel.

def random_restart_kernel(moes, x0_fct=None, sigma0=None, opts=None, **kwargs):

create a kernel (solver) of TYPE CmaKernel with a random initial mean, or an initial mean given by the factory function x0_funct, and initial step-size sigma0.

Parameters

moes : TYPE Sofomore
A multiobjective solver instance with cma-es (of TYPE CmaKernel) solvers.
x0_fct : TYPE function, optional
A factory function that creates an initial mean. The default is None.
sigma0 : TYPE float, optional
Initial step-size of the returned kernel. The default is None.
opts : TYPE dict, optional
The returned kernel's options. The default is None.
**kwargs :
Other keyword arguments.

Returns

A kernel (solver) of TYPE CmaKernel.

def sort_decreasing(i):

Example:

moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_decreasing})

updates respectively self[-1], self[-2], ..., self[0] in the tell method of Sofomore.

def sort_even_odds(i):

Example:

moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_even_odds})

pick the kernels with even indices before the kernels with odd indices in the tell method of Sofomore.

def sort_increasing(i):

Example:

moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_increasing})

updates respectively self[0], self[1], ..., self[-1] in the tell method of Sofomore.

def sort_odds_even(i):

Example:

moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_odds_even})

pick the kernels with odd indices before the kernels with even indices in the tell method of Sofomore.

def sort_random(i):

Used for the update order of a Sofomore instance. Example:

moes = Sofomore(list_of_instances, reference_point, {'update_order': sort_random})

randomly picks the kernels to update in the tell method of Sofomore.

__author__: str =

Undocumented

__license__: str =

Undocumented

__version__: str =

Undocumented

cma_kernel_default_options_replacements =

Undocumented