|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.neural.neat.training.opp.NEATCrossover
public class NEATCrossover
Crossover is performed by mixing the link genes between the parents to produce an offspring. Only the link genes are considered for crossover. The neuron genes are chosen by virtue of which link genes were chosen. If a neuron gene is present in both parents, then we choose the neuron gene from the more fit of the two parents. For NEAT, it does not really matter what parent we get the neuron gene from. However, because HyperNEAT also encodes a unique activation function into the neuron, the selection of a neuron gene between two parents is more important. The crossover operator defines two broad classes of genes. Matching genes are those genes that are present in both parents. Non-matching genes are only present in one person. Non-matching genes are further divided into two more groups: disjoint genes: Genes in the middle of a genome that do not match between the parents. excess genes: Genes at the edge of a genome that do not match between the parents. Matching genes are inherited randomly, whereas disjoint genes (those that do not match in the middle) and excess genes (those that do not match in the end) are inherited from the more fit parent. In this case, equal fitnesses are assumed, so the disjoint and excess genes are also inherited randomly. The disabled genes may become enabled again in future generations: there is a preset chance that an inherited gene is disabled if it is disabled in either parent. This is implemented in this class via the following algorithm. First, create a counter for each parent. At each step in the loop, perform the following. If both parents have the same innovation number, then randomly choose which parent's gene to use. Increase the parent counter who contributed the gene. Else if one parent has a lower innovation number than the other, then include the lower innovation gene if its parent is the most fit. Increase the parent counter who contributed the gene. ----------------------------------------------------------------------------- http://www.cs.ucf.edu/~kstanley/ Encog's NEAT implementation was drawn from the following three Journal Articles. For more complete BibTeX sources, see NEATNetwork.java. Evolving Neural Networks Through Augmenting Topologies Generating Large-Scale Neural Networks Through Discovering Geometric Regularities Automatic feature selection in neuroevolution
Constructor Summary | |
---|---|
NEATCrossover()
|
Method Summary | |
---|---|
void |
addNeuronID(long nodeID,
List<NEATNeuronGene> vec,
NEATGenome best,
NEATGenome notBest)
Add a neuron. |
void |
init(EvolutionaryAlgorithm theOwner)
Init this operator. |
int |
offspringProduced()
|
int |
parentsNeeded()
|
void |
performOperation(Random rnd,
Genome[] parents,
int parentIndex,
Genome[] offspring,
int offspringIndex)
Perform the evolutionary operation. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NEATCrossover()
Method Detail |
---|
public void addNeuronID(long nodeID, List<NEATNeuronGene> vec, NEATGenome best, NEATGenome notBest)
nodeID
- The neuron id.vec
- THe list of id's used.public void init(EvolutionaryAlgorithm theOwner)
init
in interface EvolutionaryOperator
theOwner
- The evolutionary algorithm used with this operator.public int offspringProduced()
offspringProduced
in interface EvolutionaryOperator
public int parentsNeeded()
parentsNeeded
in interface EvolutionaryOperator
public void performOperation(Random rnd, Genome[] parents, int parentIndex, Genome[] offspring, int offspringIndex)
performOperation
in interface EvolutionaryOperator
rnd
- A random number generator.parents
- The parents.parentIndex
- The index into the parents array.offspring
- The offspring.offspringIndex
- An index into the offspring array.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |