modea.Mutation module¶
This Module contains a collection of Mutation operators to be used in the ES-Framework
A Mutation operator mutates an Individual’s genotype inline, thus returning nothing.
-
modea.Mutation.
CMAMutation
(individual, param, sampler, threshold_convergence=False)¶ CMA mutation: x = x + (sigma * B*D*N(0,I))
Parameters: - individual –
FloatIndividual
to be mutated - param –
Parameters
object to store settings - sampler –
Sampling
module from which the random values should be drawn - threshold_convergence – Boolean: Should threshold convergence be applied. Default: False
- individual –
-
modea.Mutation.
MIES_Mutate
(individual, param, options, num_options)¶ Self-adaptive mixed-integer mutation of the structure of an ES
Parameters: - individual –
MixedIntegerIndividual
whose integer-part will be mutated - param –
Parameters
object - options – List of tuples
options
with the number of tunable parameters per module - num_options – List
num_options
with the number of available modules per module position that are available to choose from
- individual –
-
modea.Mutation.
MIES_MutateDiscrete
(individual, begin, end, u, num_options, options)¶ Mutate the discrete part of a Mixed-Integer representation
Parameters: - individual – The individual to mutate
- begin – Start index of the discrete part of the individual’s representation
- end – End index of the discrete part of the individual’s representation
- u – A pre-determined random value from a Gaussian distribution
- num_options – List
num_options
with the number of available modules per module position that are available to choose from - options – List of tuples
options
with the number of tunable parameters per module
Returns: A boolean mask array to be used for further conditional mutations based on which modules are active
-
modea.Mutation.
MIES_MutateFloats
(conditional_mask, individual, begin, end, u, param)¶ Mutate the floating point part of a Mixed-Integer representation
Parameters: - conditional_mask – Conditional mask that determines which floating point values are allowed to mutate
- individual – The individual to mutate
- begin – Start index of the integer part of the individual’s representation
- end – End index of the integer part of the individual’s representation
- u – A pre-determined random value from a Gaussian distribution
- param –
Parameters
object
-
modea.Mutation.
MIES_MutateIntegers
(individual, begin, end, u, param)¶ Mutate the integer part of a Mixed-Integer representation
Parameters: - individual – The individual to mutate
- begin – Start index of the integer part of the individual’s representation
- end – End index of the integer part of the individual’s representation
- u – A pre-determined random value from a Gaussian distribution
- param –
Parameters
object
-
modea.Mutation.
adaptStepSize
(individual)¶ Given the current individual, randomly determine a new step size offset that can be no greater than maxStepSize - baseStepSize
Parameters: individual – The FloatIndividual
object whose step size should be adapted
-
modea.Mutation.
addRandomOffset
(individual, param, sampler)¶ Mutation 1: x = x + sigma*N(0,I)
Parameters: - individual –
FloatIndividual
to be mutated - param –
Parameters
object to store settings - sampler –
Sampling
module from which the random values should be drawn
- individual –
-
modea.Mutation.
mutateBitstring
(individual)¶ Simple 1/n bit-flip mutation
Parameters: individual – Individual
with a bit-string as genotype to undergo p=1/n mutation
-
modea.Mutation.
mutateFloatList
(individual, param, options)¶ Self-adaptive, uniformly random floating point mutation on the tunable parameters of an ES
Parameters: - individual –
MixedIntegerIndividual
whose integer-part will be mutated - param –
Parameters
object - options – List of tuples
options
with the number of tunable parameters per module
- individual –
-
modea.Mutation.
mutateIntList
(individual, param, num_options_per_module)¶ Self-adaptive random integer mutation to mutate the structure of an ES
Parameters: - individual –
MixedIntegerIndividual
whose integer-part will be mutated - param –
Parameters
object - num_options_per_module – List
num_options
with the number of available modules per module position that are available to choose from
- individual –
-
modea.Mutation.
mutateMixedInteger
(individual, param, options, num_options_per_module)¶ Self-adaptive mixed-integer mutation of the structure of an ES
Parameters: - individual –
MixedIntegerIndividual
whose integer-part will be mutated - param –
Parameters
object - options – List of tuples
options
with the number of tunable parameters per module - num_options_per_module – List
num_options
with the number of available modules per module position that are available to choose from
- individual –