I
- Type of individuals to mutatepublic abstract class ParametricMutator<I extends NeuralNetIndividual> extends NeuralNetMutator<I>
Parametric mutator for neural nets, mutate the weights of the neural nets mutated. IMPORTANT NOTE: Parametric mutator works directly with he individuals instead of returning a mutated copy of them. This is for performance reasons. If you want to use another mutator you have to consider that individuals will be changed when you use parametric mutation
Modifier and Type | Field and Description |
---|---|
protected double |
alphaInput
Current alpha coeficient for the input weigths
|
protected double |
alphaOutput
Current alpha coeficient for the output weigths
|
protected double |
amplitude
Amplitude coefficient for allowed weights
|
protected double |
fitDif
Difference between two fitnesses that we consider
enoung to say that the fitness has improved
|
protected double |
initialAlphaInput
Initial alpha coeficient for the input weigthts
|
protected double |
initialAlphaOutput
Initial alpha coeficient for the output weigthts
|
protected java.util.Hashtable<java.lang.String,INeuronParametricMutator> |
neuronParametricMutators
Parametric Mutators of a specific neuron
|
protected boolean |
selective
Selective mutator
|
protected double |
temperExponent
Temperature exponent for the mutations
|
species
Constructor and Description |
---|
ParametricMutator()
Empty Constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
alphaControlParametersUpdate(double newFitness,
double fitness)
Updates alpha control parameters at the end of each
neuron mutation, if neccesary
|
abstract void |
alphaInit()
Init the values of alpha parameters used in the mutations
|
protected abstract void |
alphaUpdate(double bestFitness)
Updates the values of alpha parameters at the beginning
of a generation
|
void |
configure(Configuration settings)
Configuration parameters for ParametricMutator are:
[@selective] boolean (default=false)
If this parameter is set to true only certain randomly
selected nodes are parametrically mutated. |
double |
getAlphaInput()
Returns the alpha coeficient for the input weigths
|
double |
getAlphaOutput()
Returns the alpha coeficient for the output weigths
|
double |
getAmplitude()
Returns the amplitude coefficient for the weights in mutations
|
double |
getFitDif()
Returns the difference between two fitnesses that we consider
enough to say that the fitness has improved
|
double |
getInitialAlphaInput()
Returns the initial alpha coeficient for the input weigths
|
double |
getInitialAlphaOutput()
Returns the initial alpha coeficient for the input weigths
|
double |
getTemperExponent()
Returns the temperature exponent to be used in the mutations
|
boolean |
isSelective()
Returns a boolean indicating if the mutator is selective
|
void |
mutateNext()
Mutates the next individual
|
protected void |
prepareMutation()
Prepares the mutation and actualize the alpha value
|
void |
setAmplitude(double amplitude)
Sets the amplitude coefficient for the weights in mutations
|
void |
setFitDif(double fitDif)
Sets the difference between two fitnesses that we consider
enough to say that the fitness has improved
|
void |
setInitialAlphaInput(double initialAlphaInput)
Sets the initial alpha coeficient for the input weigths
|
void |
setInitialAlphaOutput(double initialAlphaOutput)
Sets the initial alpha coeficient for the output weigths
|
void |
setSelective(boolean selective)
Sets a boolean indicating if the mutator is selective
|
void |
setTemperExponent(double temperExponent)
Sets the temperature exponent to be used in the mutations
|
protected double temperExponent
protected double amplitude
protected boolean selective
protected double initialAlphaInput
protected double initialAlphaOutput
protected double fitDif
protected java.util.Hashtable<java.lang.String,INeuronParametricMutator> neuronParametricMutators
protected double alphaInput
protected double alphaOutput
public double getTemperExponent()
Returns the temperature exponent to be used in the mutations
public void setTemperExponent(double temperExponent)
Sets the temperature exponent to be used in the mutations
temperExponent
- New temperature exponentpublic double getAmplitude()
Returns the amplitude coefficient for the weights in mutations
public void setAmplitude(double amplitude)
Sets the amplitude coefficient for the weights in mutations
amplitude
- New amplitude coefficientpublic boolean isSelective()
Returns a boolean indicating if the mutator is selective
public void setSelective(boolean selective)
Sets a boolean indicating if the mutator is selective
selective
- New selective boolean valuepublic double getAlphaInput()
Returns the alpha coeficient for the input weigths
public double getAlphaOutput()
Returns the alpha coeficient for the output weigths
public double getInitialAlphaInput()
Returns the initial alpha coeficient for the input weigths
public void setInitialAlphaInput(double initialAlphaInput)
Sets the initial alpha coeficient for the input weigths
initialAlphaInput
- Initial alpha coeficient for the input weigthspublic double getInitialAlphaOutput()
Returns the initial alpha coeficient for the input weigths
public void setInitialAlphaOutput(double initialAlphaOutput)
Sets the initial alpha coeficient for the output weigths
initialAlphaOutput
- Initial alpha coeficient for the output weigthspublic double getFitDif()
Returns the difference between two fitnesses that we consider enough to say that the fitness has improved
public void setFitDif(double fitDif)
Sets the difference between two fitnesses that we consider enough to say that the fitness has improved
fitDif
- New significative fitness differenceprotected void prepareMutation()
Prepares the mutation and actualize the alpha value
prepareMutation
in class NeuralNetMutator<I extends NeuralNetIndividual>
public void mutateNext()
Mutates the next individual
public abstract void alphaInit()
Init the values of alpha parameters used in the mutations
protected abstract void alphaUpdate(double bestFitness)
Updates the values of alpha parameters at the beginning of a generation
bestFitness
- Best fitness of this generationprotected abstract void alphaControlParametersUpdate(double newFitness, double fitness)
Updates alpha control parameters at the end of each neuron mutation, if neccesary
newFitness
- Result fitness of the mutationfitness
- Previous fitness befor making the mutationpublic void configure(Configuration settings)
Configuration parameters for ParametricMutator are:
[@selective] boolean (default=false)
If this parameter is set to true
only certain randomly
selected nodes are parametrically mutated.
temperature-exponent[@value] double (default=1)
Temperature exponent to be used for obtaining temperature
of each indivual mutated.
amplitude[@value] double (default=5)
Amplitude factor to increase the range of parametric variations
of mutated weights.
fitness-difference[@value] double (default=0.0000001)
Difference between two fitnesses that we consider
enoung to say that the fitness has improved
initial-alpha-values: complex
Initial values of alpha parameters.
initial-alpha-values[@input] double (default=0.5)
Initial value of alpha parameter used for input weights.
initial-alpha-values[@ouput] double (default=1)
Initial value of alpha parameter used for output weights.
settings
- configuration settings for the mutator.