org.encog.neural.neat
Class NEATNetwork

java.lang.Object
  extended by org.encog.ml.BasicML
      extended by org.encog.neural.neat.NEATNetwork
All Implemented Interfaces:
Serializable, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression

public class NEATNetwork
extends BasicML
implements MLRegression, MLError

Implements a NEAT network as a synapse between two layers. In Encog, a NEAT network is created by using a NEATSynapse between an input and output layer. NEAT networks only have an input and an output layer. There are no actual hidden layers. Rather this synapse will evolve many hidden neurons that have connections that are not easily defined by layers. Connections can be feedforward, recurrent, or self-connected. 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/

See Also:
Serialized Form

Field Summary
static String PROPERTY_LINKS
           
static String PROPERTY_NETWORK_DEPTH
           
static String PROPERTY_SNAPSHOT
           
 
Constructor Summary
NEATNetwork()
          Default constructor.
NEATNetwork(int inputCount, int outputCount)
          Construct a NEAT network.
NEATNetwork(int inputCount, int outputCount, List<NEATNeuron> neurons, ActivationFunction activationFunction, int networkDepth)
          Construct a NEAT synapse.
 
Method Summary
 double calculateError(MLDataSet data)
          Calculate the error for this neural network.
 MLData compute(MLData input)
          Compute the output from this synapse.
 int getActivationCycles()
           
 ActivationFunction getActivationFunction()
           
 int getInputCount()
           
 int getNetworkDepth()
           
 List<NEATNeuron> getNeurons()
           
 int getOutputCount()
           
 void setActivationCycles(int activationCycles)
           
 void setActivationFunction(ActivationFunction activationFunction)
          Set the activation function.
 void setInputCount(int i)
           
 void setNetworkDepth(int i)
           
 void setOutputCount(int i)
           
 void updateProperties()
          Update any objeccts when a property changes.
 
Methods inherited from class org.encog.ml.BasicML
getProperties, getPropertyDouble, getPropertyLong, getPropertyString, setProperty, setProperty, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROPERTY_NETWORK_DEPTH

public static final String PROPERTY_NETWORK_DEPTH
See Also:
Constant Field Values

PROPERTY_LINKS

public static final String PROPERTY_LINKS
See Also:
Constant Field Values

PROPERTY_SNAPSHOT

public static final String PROPERTY_SNAPSHOT
See Also:
Constant Field Values
Constructor Detail

NEATNetwork

public NEATNetwork()
Default constructor.


NEATNetwork

public NEATNetwork(int inputCount,
                   int outputCount,
                   List<NEATNeuron> neurons,
                   ActivationFunction activationFunction,
                   int networkDepth)
Construct a NEAT synapse.

Parameters:
inputCount - The number of input neurons.
outputCount - The number of output neurons.
neurons - The neurons in this synapse.
activationFunction - The activation function to use.
networkDepth - The depth of the network.

NEATNetwork

public NEATNetwork(int inputCount,
                   int outputCount)
Construct a NEAT network.

Parameters:
inputCount - The input count.
outputCount - The output count.
Method Detail

compute

public MLData compute(MLData input)
Compute the output from this synapse.

Specified by:
compute in interface MLRegression
Parameters:
input - The input to this synapse.
Returns:
The output from this synapse.

getActivationFunction

public ActivationFunction getActivationFunction()
Returns:
The activation function.

getNetworkDepth

public int getNetworkDepth()
Returns:
The network depth.

getNeurons

public List<NEATNeuron> getNeurons()
Returns:
The NEAT neurons.

setActivationFunction

public void setActivationFunction(ActivationFunction activationFunction)
Set the activation function.

Parameters:
activationFunction - The activation function.

getInputCount

public int getInputCount()
Specified by:
getInputCount in interface MLInput
Returns:
The input.

getOutputCount

public int getOutputCount()
Specified by:
getOutputCount in interface MLOutput
Returns:
The output count.

updateProperties

public void updateProperties()
Description copied from interface: MLProperties
Update any objeccts when a property changes.

Specified by:
updateProperties in interface MLProperties
Specified by:
updateProperties in class BasicML

setInputCount

public void setInputCount(int i)

setOutputCount

public void setOutputCount(int i)

setNetworkDepth

public void setNetworkDepth(int i)

calculateError

public double calculateError(MLDataSet data)
Calculate the error for this neural network.

Specified by:
calculateError in interface MLError
Parameters:
data - The training set.
Returns:
The error percentage.

getActivationCycles

public int getActivationCycles()

setActivationCycles

public void setActivationCycles(int activationCycles)


Copyright © 2012. All Rights Reserved.