AskTellCMAES¶
-
class
modcma.asktellcmaes.AskTellCMAES(*args, **kwargs)¶ Bases:
modcma.modularcmaes.ModularCMAESAsk tell interface for the ModularCMAES.
Methods Summary
ask()Retrieve the next indivual from the ask_queue.
fitness_func(x)Overwrite function call for fitness_func, calls register_individual.
Add new individuals to self.ask_queue.
run()Method is disabled on this interface.
Overwrite ~modcma.modularcmaes.ModularCMAES.sequential_break_conditions.
step()Method is disabled on this interface.
tell(xi, fi)Process a provided fitness value fi for a given individual xi.
Methods Documentation
-
ask() → numpy.ndarray¶ Retrieve the next indivual from the ask_queue.
If the ask_queue is not defined yet, it is defined and mutate is called in order to fill it.
- Returns
- Return type
np.ndarray
-
fitness_func(x: numpy.ndarray) → None¶ Overwrite function call for fitness_func, calls register_individual.
-
register_individual(x: numpy.ndarray) → None¶ Add new individuals to self.ask_queue.
- Parameters
x (np.ndarray) – The vector to be added to the ask_queue
-
run()¶ Method is disabled on this interface.
- Raises
NotImplementedError –
-
sequential_break_conditions(i: int, f: float) → None¶ Overwrite ~modcma.modularcmaes.ModularCMAES.sequential_break_conditions.
Raises not implemented if sequential selection is enabled, which is not supported in the ask-tell interface.
- Parameters
i (int) – The index of the currently sampled individual in the population
f (float) – The fitness value of the currently sampled individual
- Raises
NotImplementedError – When self.parameters.sequential == True
-
step()¶ Method is disabled on this interface.
- Raises
NotImplementedError –
-
tell(xi: numpy.ndarray, fi: float) → None¶ Process a provided fitness value fi for a given individual xi.
- Parameters
xi (np.ndarray) – An individual previously returned by ask()
fi (float) – The fitness value for xi
- Raises
RuntimeError – When ask() is not called before tell()
ValueError – When an unknown xi is provided to the method
- Warns
UserWarning – When the same xi is provided more than once
-