I
- Type of StructuralMutatorpublic class StructuralMutator<I extends NeuralNetIndividual> extends NeuralNetMutator<I>
Structural mutator for neural nets IMPORTANT NOTE: Structural 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 structural mutation
Modifier and Type | Field and Description |
---|---|
protected int |
hiddenLinksPercentage
Percentage of links to remove in the mutations
|
protected int |
maxLinksAdd
Maximum number of links to add in the mutations
|
protected int |
maxLinksDel
Maximum number of links to remove in the mutations
|
protected int |
maxNeuronsAdd
Maximum number of neurons to add in the mutations
|
protected int |
maxNeuronsDel
Maximum number of neurons to remove in the mutations
|
protected int |
minLinksAdd
Minimum number of links to add in the mutations
|
protected int |
minLinksDel
Minimum number of links to remove in the mutations
|
protected int |
minNeuronsAdd
Minimum number of neurons to add in the mutations
|
protected int |
minNeuronsDel
Minimum number of neurons to remove in the mutations
|
protected java.util.Hashtable<java.lang.String,INeuronStructuralMutator> |
neuronStructuralMutators
Structural Mutators of a specific neuron
|
protected boolean |
nOfLinksRelative
Has the operator a relative added/removed number of links, depending of the neural net
|
protected int |
outputLinksPercentage
Percentage of links to remove in the mutations
|
protected double |
significativeWeigth
Minimum value of new weigths
|
protected double |
temperExponent
Temperature exponent for the mutations
|
species
Constructor and Description |
---|
StructuralMutator()
Empty Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
configure(Configuration settings)
Configuration parameters for StructuralMutator are:
|
int |
getMaxLinksAdd()
Returns the maximum number of links to add in mutations
|
int |
getMaxLinksDel()
Returns the maximum number of links to remove in mutations
|
int |
getMaxNeuronsAdd()
Returns the maximum number of neurons to add in mutations
|
int |
getMaxNeuronsDel()
Returns the maximum number of neurons to remove in mutations
|
int |
getMinLinksAdd()
Returns the minimum number of links to add in mutations
|
int |
getMinLinksDel()
Returns the minimum number of links to remove in mutations
|
int |
getMinNeuronsAdd()
Returns the minimum number of neurons to add in mutations
|
int |
getMinNeuronsDel()
Returns the minimum number of neurons to remove in mutations
|
double |
getSignificativeWeigth()
Returns the significative weigth for new links
|
double |
getTemperExponent()
Returns the temperature exponent to be used in the mutations
|
void |
mutateNext()
Mutates the next individual
|
void |
setMaxLinksAdd(int maxLinksAdd)
Sets the maximum number of links to add in mutations
|
void |
setMaxLinksDel(int maxLinksDel)
Sets the maximum number of links to remove in mutations
|
void |
setMaxNeuronsAdd(int maxNeuronsAdd)
Sets the maximum number of neurons to add in mutations
|
void |
setMaxNeuronsDel(int maxNeuronsDel)
Sets the maximum number of neurons to remove in mutations
|
void |
setMinLinksAdd(int minLinksAdd)
Sets the minimum number of links to add in mutations
|
void |
setMinLinksDel(int minLinksDel)
Sets the minimum number of links to remove in mutations
|
void |
setMinNeuronsAdd(int minNeuronsAdd)
Sets the minimum number of neurons to add in mutations
|
void |
setMinNeuronsDel(int minNeuronsDel)
Sets the minimum number of neurons to remove in mutations
|
void |
setSignificativeWeigth(double significativeWeigth)
Sets the significative weigth for new links
|
void |
setTemperExponent(double temperExponent)
Sets the temperature exponent to be used in the mutations
|
prepareMutation
protected double temperExponent
protected int minNeuronsAdd
protected int maxNeuronsAdd
protected int minNeuronsDel
protected int maxNeuronsDel
protected int minLinksAdd
protected int maxLinksAdd
protected int minLinksDel
protected int maxLinksDel
protected double significativeWeigth
protected boolean nOfLinksRelative
protected int hiddenLinksPercentage
protected int outputLinksPercentage
protected java.util.Hashtable<java.lang.String,INeuronStructuralMutator> neuronStructuralMutators
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 getSignificativeWeigth()
Returns the significative weigth for new links
public void setSignificativeWeigth(double significativeWeigth)
Sets the significative weigth for new links
significativeWeigth
- New significative weigthpublic int getMaxLinksAdd()
Returns the maximum number of links to add in mutations
public void setMaxLinksAdd(int maxLinksAdd)
Sets the maximum number of links to add in mutations
maxLinksAdd
- New maximum number of links to addpublic int getMaxLinksDel()
Returns the maximum number of links to remove in mutations
public void setMaxLinksDel(int maxLinksDel)
Sets the maximum number of links to remove in mutations
maxLinksDel
- New maximum number of links to removepublic int getMaxNeuronsAdd()
Returns the maximum number of neurons to add in mutations
public void setMaxNeuronsAdd(int maxNeuronsAdd)
Sets the maximum number of neurons to add in mutations
maxNeuronsAdd
- New maximum number of neurons to addpublic int getMaxNeuronsDel()
Returns the maximum number of neurons to remove in mutations
public void setMaxNeuronsDel(int maxNeuronsDel)
Sets the maximum number of neurons to remove in mutations
maxNeuronsDel
- New maximum number of neurons to removepublic int getMinLinksAdd()
Returns the minimum number of links to add in mutations
public void setMinLinksAdd(int minLinksAdd)
Sets the minimum number of links to add in mutations
minLinksAdd
- New maximum number of links to add in mutationspublic int getMinLinksDel()
Returns the minimum number of links to remove in mutations
public void setMinLinksDel(int minLinksDel)
Sets the minimum number of links to remove in mutations
minLinksDel
- New maximum number of links to remove in mutationspublic int getMinNeuronsAdd()
Returns the minimum number of neurons to add in mutations
public void setMinNeuronsAdd(int minNeuronsAdd)
Sets the minimum number of neurons to add in mutations
minNeuronsAdd
- New minimum number of neurons to addpublic int getMinNeuronsDel()
Returns the minimum number of neurons to remove in mutations
public void setMinNeuronsDel(int minNeuronsDel)
Sets the minimum number of neurons to remove in mutations
minNeuronsDel
- New minimum number of neurons to removepublic void mutateNext()
Mutates the next individual
public void configure(Configuration settings)
Configuration parameters for StructuralMutator are:
settings
- Settings to configure
temperature-exponent[@value] double (default=1)
Temperature exponent to be used for obtaining temperature
of each indivual mutated.
significative-weigth[@value] double (default=0.0000001)
Minimum value of new weigths.
neurons-ranges: complex
Ranges of neurons added or deleted.
neurons-ranges.added: complex
Ranges of neurons added.
neurons-ranges.added[@min] int (default=1)
Minimum number of added neurons.
neurons-ranges.added[@max] int (default=2)
Maximum number of added neurons.
neurons-ranges.deleted: complex
Ranges of neurons deleted.
neurons-ranges.deleted[@min] int (default=1)
Minimum number of deleted neurons.
neurons-ranges.deleted[@max] int (default=2)
Maximum number of deleted neurons.
links-ranges: complex
Ranges of links added or deleted.
links-ranges[@relative] boolean (default=false)
If we use a relative number of links, then we have to specify
a percentage of links added or deleted, depending of the layer
operated
links-ranges.added: complex
Ranges of absolute number of links added
(when links-ranges.relative = false
).
links-ranges.added[@min] int (default=1)
Minimum number of added links.
links-ranges.added[@max] int (default=6)
Maximum number of added links.
links-ranges.deleted: complex
Ranges of absolute number of links deleted
(when links-ranges.relative = false
).
links-ranges.deleted[@min] int (default=1)
Minimum number of deleted links.
links-ranges.deleted[@max] int (default=6)
Maximum number of deleted links.
links-ranges.percentages: complex
Percentages of links added and deleted
(when links-ranges.relative = true
).
links-ranges.percentages[@hidden] int (default=30)
Percentage of links added/deleted of each neuron of a hidden layer.
links-ranges.percentages[@output] int (default=5)
Percentage of links added/deleted of each neuron of an output layer.