f3dasm_optimize.CMAES

class CMAES(domain, population=30, force_bounds=True, seed=None, **kwargs)[source]

Bases: PygmoAlgorithm

Covariance Matrix Adaptation Evolution Strategy optimizer implemented from pygmo

List of Public Methods

update_step

Update step of the algorithm

Attributes

require_gradients

type

Methods

_check_number_of_datapoints()
Check if the number of datapoints is sufficient

for the initial population

Raises:

ValueError – Raises when the number of datapoints is insufficient

_construct_model(data_generator)

Method that is called before the optimization starts. This method can be used to construct a model based on the available data or a specific data generator.

Parameters:

data_generator (DataGenerator) – DataGenerator object

Note

When this method is not implemented, the method will do nothing.

_get_info()[source]

Give a list of characteristic features of this optimizer

Return type:

List[str]

Returns:

List of strings denoting the characteristics of this optimizer

property _population: int

Property to return the population size of the optimizer

Returns:

Number of individuals in the population

Return type:

int

Note

If the population is not set, the property will return 1 This is done to prevent errors when the population size is not an available attribute in a custom optimizer class.

_reset(data)

Reset the optimizer to its initial state

property _seed: int

Property to return the seed of the optimizer

Returns:

Seed of the optimizer

Return type:

int | None

Note

If the seed is not set, the property will return None This is done to prevent errors when the seed is not an available attribute in a custom optimizer class.

_set_algorithm()[source]

Method that can be implemented to set the optimization algorithm. Whenever the reset method is called, this method will be called to reset the algorithm to its initial state.

_set_data(data)

Set the data attribute to the given data

update_step(data_generator)

Update step of the algorithm

Parameters:

function – function to be evaluated

Return type:

Tuple[ndarray, ndarray]

Returns:

tuple of updated input parameters (x) and objecti value (y)