org.encog.neural.neat.training
Class NEATGenome
- java.lang.Object
-
- org.encog.ml.ea.genome.BasicGenome
-
- org.encog.neural.neat.training.NEATGenome
-
- Direct Known Subclasses:
- HyperNEATGenome
public class NEATGenome extends BasicGenome implements java.lang.Cloneable, java.io.Serializable
Implements a NEAT genome. This is a "blueprint" for creating a neural network. ----------------------------------------------------------------------------- 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- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description NEATGenome()Empty constructor for persistence.NEATGenome(java.util.List<NEATNeuronGene> neurons, java.util.List<NEATLinkGene> links, int inputCount, int outputCount)Create a NEAT gnome.NEATGenome(NEATGenome other)Construct a genome by copying another.NEATGenome(java.util.Random rnd, NEATPopulation pop, int inputCount, int outputCount, double connectionDensity)Create a new genome with the specified connection density.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcopy(Genome source)Copy from the specified genome into this one.NEATNeuronGenefindNeuron(long nodeID)Find the neuron with the specified nodeID.intgetInputCount()java.util.List<NEATLinkGene>getLinksChromosome()intgetNetworkDepth()java.util.List<NEATNeuronGene>getNeuronsChromosome()intgetNumGenes()intgetOutputCount()voidsetInputCount(int inputCount)voidsetNetworkDepth(int networkDepth)voidsetOutputCount(int outputCount)intsize()voidsortGenes()Sort the genes.java.lang.StringtoString()voidvalidate()Validate the structure of this genome.-
Methods inherited from class org.encog.ml.ea.genome.BasicGenome
getAdjustedScore, getBirthGeneration, getPopulation, getScore, getSource, getSpecies, setAdjustedScore, setBirthGeneration, setPopulation, setScore, setSource, setSpecies
-
-
-
-
Constructor Detail
-
NEATGenome
public NEATGenome(NEATGenome other)
Construct a genome by copying another.- Parameters:
other- The other genome.
-
NEATGenome
public NEATGenome(java.util.List<NEATNeuronGene> neurons, java.util.List<NEATLinkGene> links, int inputCount, int outputCount)
Create a NEAT gnome. Neuron genes will be added by reference, links will be copied.- Parameters:
neurons- The neurons to create.links- The links to create.inputCount- The input count.outputCount- The output count.
-
NEATGenome
public NEATGenome(java.util.Random rnd, NEATPopulation pop, int inputCount, int outputCount, double connectionDensity)Create a new genome with the specified connection density. This constructor is typically used to create the initial population.- Parameters:
rnd- Random number generator.pop- The population.inputCount- The input count.outputCount- The output count.connectionDensity- The connection density.
-
NEATGenome
public NEATGenome()
Empty constructor for persistence.
-
-
Method Detail
-
getInputCount
public int getInputCount()
- Returns:
- The number of input neurons.
-
getNetworkDepth
public int getNetworkDepth()
- Returns:
- The network depth.
-
getNumGenes
public int getNumGenes()
- Returns:
- The number of genes in the links chromosome.
-
getOutputCount
public int getOutputCount()
- Returns:
- The output count.
-
setNetworkDepth
public void setNetworkDepth(int networkDepth)
- Parameters:
networkDepth- the networkDepth to set
-
sortGenes
public void sortGenes()
Sort the genes.
-
getLinksChromosome
public java.util.List<NEATLinkGene> getLinksChromosome()
- Returns:
- the linksChromosome
-
getNeuronsChromosome
public java.util.List<NEATNeuronGene> getNeuronsChromosome()
- Returns:
- the neuronsChromosome
-
setInputCount
public void setInputCount(int inputCount)
- Parameters:
inputCount- the inputCount to set
-
setOutputCount
public void setOutputCount(int outputCount)
- Parameters:
outputCount- the outputCount to set
-
validate
public void validate()
Validate the structure of this genome.
-
copy
public void copy(Genome source)
Copy from the specified genome into this one.
-
size
public int size()
-
findNeuron
public NEATNeuronGene findNeuron(long nodeID)
Find the neuron with the specified nodeID.- Parameters:
nodeID- The nodeID to look for.- Returns:
- The neuron, if found, otherwise null.
-
toString
public java.lang.String toString()
Description copied from class:BasicGenome- Overrides:
toStringin classBasicGenome
-
-
DMelt 3.0 © DataMelt by jWork.ORG