Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.encog.neural.neat
Class NEATNetwork

    java.lang.Object
      org.encog.ml.BasicML
          org.encog.neural.neat.NEATNetwork

All Implemented Interfaces:
  Serializable, MLContext, MLError, MLInput, MLInputOutput, MLMethod, MLOutput, MLProperties, MLRegression

    public class NEATNetwork

extends BasicML
implements MLContext, 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, ActivationFunction outputActivationFunction, int networkDepth)` Construct a NEAT synapse.

Method Summary
`double` | `calculateError(MLDataSet data)` Calculate the error for this neural network.
`void` | `clearContext()` Clear any context from previous runs.
`MLData` | `compute(MLData input)` Compute the output from this synapse.
`ActivationFunction` | `getActivationFunction()`
`int` | `getInputCount()`
`int` | `getNetworkDepth()`
`List<NEATNeuron>` | `getNeurons()`
`ActivationFunction` | `getOutputActivationFunction()`
`int` | `getOutputCount()`
`boolean` | `isSnapshot()`
`void` | `setActivationFunction(ActivationFunction activationFunction)` Set the activation function.
`void` | `setInputCount(int i)`
`void` | `setNetworkDepth(int i)`
`void` | `setOutputActivationFunction(ActivationFunction outputActivationFunction)`
`void` | `setOutputCount(int i)`
`void` | `setSnapshot(boolean snapshot)` Sets if snapshot is used.
`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,
                       ActivationFunction outputActivationFunction,
                       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

### clearContext

    public void clearContext()

  Clear any context from previous runs. This sets the activation of all neurons to zero.

  Specified by:
    `clearContext` in interface `MLContext`

### 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.

### isSnapshot

    public boolean isSnapshot()

  Returns:
    True if snapshot is being used.

### setActivationFunction

    public void setActivationFunction(ActivationFunction activationFunction)

  Set the activation function.

  Parameters:
    `activationFunction` - The activation function.

### setSnapshot

    public void setSnapshot(boolean snapshot)

  Sets if snapshot is used.

  Parameters:
    `snapshot` - True if snapshot is used.

### 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)

### getOutputActivationFunction

    public ActivationFunction getOutputActivationFunction()

  Returns:
    the outputActivationFunction

### setOutputActivationFunction

    public void setOutputActivationFunction(ActivationFunction outputActivationFunction)

  Parameters:
    `outputActivationFunction` - the outputActivationFunction to set

### 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.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2011. All Rights Reserved.