org.encog.neural.neat
Class NEATNetwork
- java.lang.Object
-
- org.encog.neural.neat.NEATNetwork
-
- All Implemented Interfaces:
- java.io.Serializable, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLRegression
public class NEATNetwork extends java.lang.Object implements MLRegression, MLError, java.io.Serializable
NEAT networks relieve the programmer of the need to define the hidden layer structure of the neural network. The output from the neural network can be calculated normally or using a snapshot. The snapshot mode is slower, but it can be more accurate. The snapshot handles recurrent layers better, as it takes the time to loop through the network multiple times to "flush out" the recurrent links. NeuroEvolution of Augmenting Topologies (NEAT) is a genetic algorithm for the generation of evolving artificial neural networks. It was developed by Ken Stanley while at The University of Texas at Austin. http://www.cs.ucf.edu/~kstanley/ The following Journal articles were used to implement NEAT/HyperNEAT in Encog. Provided in BibTeX form. Article{stanley:ec02,title={Evolving Neural Networks Through Augmenting Topologies}, author={Kenneth O. Stanley and Risto Miikkulainen}, volume={10}, journal={Evolutionary Computation}, number={2}, pages={99-127}, url= "http://nn.cs.utexas.edu/?stanley:ec02" , year={2002}} MISC{Gauci_abstractgenerating, author = {Jason Gauci and Kenneth Stanley}, title = {ABSTRACT Generating Large-Scale Neural Networks Through Discovering Geometric Regularities}, year = {}} INPROCEEDINGS{Whiteson05automaticfeature, author = {Shimon Whiteson and Kenneth O. Stanley and Risto Miikkulainen}, title = {Automatic feature selection in neuroevolution}, booktitle = {In Genetic and Evolutionary Computation Conference}, year = {2005}, pages = {1225--1232}, publisher = {ACM Press} }- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description NEATNetwork(int inputNeuronCount, int outputNeuronCount, java.util.List<NEATLink> connectionArray, ActivationFunction[] theActivationFunctions)Construct a NEAT network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalculateError(MLDataSet data)Calculate the error for this neural network.MLDatacompute(MLData input)Compute the output from this synapse.intgetActivationCycles()ActivationFunction[]getActivationFunctions()intgetInputCount()NEATLink[]getLinks()intgetOutputCount()intgetOutputIndex()double[]getPostActivation()double[]getPreActivation()doublegetRelaxationThreshold()booleanisHasRelaxed()voidsetActivationCycles(int activationCycles)Set the number of activation cycles to use.voidsetHasRelaxed(boolean hasRelaxed)Set true, if the network has relaxed and values no longer changing.voidsetRelaxationThreshold(double relaxationThreshold)The amount of change allowed before the network is considered to have relaxed.
-
-
-
Constructor Detail
-
NEATNetwork
public NEATNetwork(int inputNeuronCount, int outputNeuronCount, java.util.List<NEATLink> connectionArray, ActivationFunction[] theActivationFunctions)Construct a NEAT network. The links that are passed in also define the neurons.- Parameters:
inputNeuronCount- The input neuron count.outputNeuronCount- The output neuron count.connectionArray- The links.theActivationFunctions- The activation functions.
-
-
Method Detail
-
calculateError
public double calculateError(MLDataSet data)
Calculate the error for this neural network.- Specified by:
calculateErrorin interfaceMLError- Parameters:
data- The training set.- Returns:
- The error percentage.
-
compute
public MLData compute(MLData input)
Compute the output from this synapse.- Specified by:
computein interfaceMLRegression- Parameters:
input- The input to this synapse.- Returns:
- The output from this synapse.
-
getActivationCycles
public int getActivationCycles()
- Returns:
- The number of activation cycles to use.
-
getActivationFunctions
public ActivationFunction[] getActivationFunctions()
- Returns:
- The activation functions.
-
getInputCount
public int getInputCount()
- Specified by:
getInputCountin interfaceMLInput- Returns:
- The input.
-
getLinks
public NEATLink[] getLinks()
- Returns:
- The links in the neural network.
-
getOutputCount
public int getOutputCount()
- Specified by:
getOutputCountin interfaceMLOutput- Returns:
- The output count.
-
getOutputIndex
public int getOutputIndex()
- Returns:
- The starting location of the output neurons.
-
getPostActivation
public double[] getPostActivation()
- Returns:
- The post-activation values, used as the output from the neurons.
-
getPreActivation
public double[] getPreActivation()
- Returns:
- The pre-activation values, used to feed the neurons.
-
getRelaxationThreshold
public double getRelaxationThreshold()
- Returns:
- The amount of change allowed before the network is considered to have relaxed.
-
isHasRelaxed
public boolean isHasRelaxed()
- Returns:
- True, if the network has relaxed and values no longer changing. Used when activationCycles is set to zero for auto.
-
setActivationCycles
public void setActivationCycles(int activationCycles)
Set the number of activation cycles to use.- Parameters:
activationCycles- The number of activation cycles.
-
setHasRelaxed
public void setHasRelaxed(boolean hasRelaxed)
Set true, if the network has relaxed and values no longer changing. Used when activationCycles is set to zero for auto.- Parameters:
hasRelaxed- True if the network has relaxed.
-
setRelaxationThreshold
public void setRelaxationThreshold(double relaxationThreshold)
The amount of change allowed before the network is considered to have relaxed.- Parameters:
relaxationThreshold- The relaxation threshold.
-
-
DMelt 3.0 © DataMelt by jWork.ORG