public class SigmNeuronStructuralMutator extends java.lang.Object implements INeuronStructuralMutator<SigmNeuron>
Structural Mutator of Sigmoidal Neurons.
Modifier and Type | Field and Description |
---|---|
protected IRandGen |
randgen
Random generator used in mutation
|
protected double |
significativeWeigth
Minimum value of new weigths
|
Constructor and Description |
---|
SigmNeuronStructuralMutator()
Empty constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
addLink(SigmNeuron neuron,
LinkedLayer layer,
ILayer<? extends INeuron> previousLayer,
int indexNeuron,
int indexOrigin)
Adds a link to a neuron of an specific layer from
a specific origin neuron
|
void |
addNeuron(SigmNeuron neuron,
LinkedLayer layer,
ILayer<? extends INeuron> previousLayer,
LinkedLayer nextLayer)
Adds a neuron into a specific layer
|
IRandGen |
getRandgen()
Returns the random generator used in mutation
|
double |
getSignificativeWeigth()
Returns the minimum value of new weigths
|
boolean |
removeLink(SigmNeuron neuron,
int indexOrigin)
Removes a link of a neuron of an specific layer from
a specific origin neuron
|
void |
removeNeuron(LinkedLayer layer,
LinkedLayer nextLayer,
int indexNeuron)
Removes a neuron of a specific layer
|
void |
setRandgen(IRandGen randgen)
Sets the random generator used in mutation
|
void |
setSignificativeWeigth(double significativeWeigth)
Sets the minimum value of new weigths
|
void |
unitNeuronsWeights(SigmNeuron firstNeuron,
SigmNeuron secondNeuron,
LinkedLayer layer,
LinkedLayer nextLayer,
int indexFirstNeuron,
int indexSecondNeuron)
Units the weights of two specific neurons, and stores
the result in the first neuron
|
protected IRandGen randgen
protected double significativeWeigth
public SigmNeuronStructuralMutator()
Empty constructor
public IRandGen getRandgen()
Returns the random generator used in mutation
public void setRandgen(IRandGen randgen)
Sets the random generator used in mutation
randgen
- New random generatorpublic double getSignificativeWeigth()
Returns the minimum value of new weigths
public void setSignificativeWeigth(double significativeWeigth)
Sets the minimum value of new weigths
significativeWeigth
- New minimum value of new weigthspublic void addNeuron(SigmNeuron neuron, LinkedLayer layer, ILayer<? extends INeuron> previousLayer, LinkedLayer nextLayer)
Adds a neuron into a specific layer
addNeuron
in interface INeuronStructuralMutator<SigmNeuron>
neuron
- Neuron to add into the layerlayer
- Hidden layer to add the neuronpreviousLayer
- Previous layer to the selected hidden layernextLayer
- Next layer to the selected hidden layerpublic void removeNeuron(LinkedLayer layer, LinkedLayer nextLayer, int indexNeuron)
Removes a neuron of a specific layer
removeNeuron
in interface INeuronStructuralMutator<SigmNeuron>
layer
- Hidden layer to remove the neuronnextLayer
- Next layer to the selected hidden layerindexNeuron
- Index of neuron to removepublic boolean addLink(SigmNeuron neuron, LinkedLayer layer, ILayer<? extends INeuron> previousLayer, int indexNeuron, int indexOrigin)
Adds a link to a neuron of an specific layer from a specific origin neuron
addLink
in interface INeuronStructuralMutator<SigmNeuron>
neuron
- Neuron to add the linklayer
- Hidden layer to add the linkpreviousLayer
- Previous layer to the selected hidden layerindexNeuron
- Index of neuron to add the linkindexOrigin
- Index of neuron that its link come from in the previous layerpublic boolean removeLink(SigmNeuron neuron, int indexOrigin)
Removes a link of a neuron of an specific layer from a specific origin neuron
removeLink
in interface INeuronStructuralMutator<SigmNeuron>
neuron
- Neuron to remove the linkindexOrigin
- Index of neuron that its link come from in the previous layerpublic void unitNeuronsWeights(SigmNeuron firstNeuron, SigmNeuron secondNeuron, LinkedLayer layer, LinkedLayer nextLayer, int indexFirstNeuron, int indexSecondNeuron)
Units the weights of two specific neurons, and stores the result in the first neuron
unitNeuronsWeights
in interface INeuronStructuralMutator<SigmNeuron>
firstNeuron
- First Neuron to unit its weightssecondNeuron
- Second Neuron to unit its weightslayer
- Hidden layer to unit the weights of two selected neuronsnextLayer
- Next layer to the selected hidden layerindexFirstNeuron
- Index of the first neuron to unitindexSecondNeuron
- Index of the second neuron to unit