org.jscience.computing.ai.neurocomputing
Class EvoFeedForwardNN

java.lang.Object
  extended by org.jscience.computing.ai.neurocomputing.NeuralNetwork
      extended by org.jscience.computing.ai.neurocomputing.FeedForwardNN
          extended by org.jscience.computing.ai.neurocomputing.EvoFeedForwardNN
All Implemented Interfaces:
java.lang.Comparable, Evolvable, Visualizable

public class EvoFeedForwardNN
extends FeedForwardNN
implements Evolvable

This class implements an evolutionary feedforward network.


Field Summary
protected  double fitnessValue
          The fitness value for this feedforward network.
protected  double[][] inputData
          The input test data.
 
Fields inherited from class org.jscience.computing.ai.neurocomputing.FeedForwardNN
nnLayers, numLayers
 
Fields inherited from class org.jscience.computing.ai.neurocomputing.NeuralNetwork
activation, visualization
 
Constructor Summary
EvoFeedForwardNN(int hidden)
          Creates a new instance of EvoFeedForwardNN
 
Method Summary
 void calculateFitness()
          Calculate the fitness for this network.
 int compareTo(java.lang.Object o)
          Compare to another feedforward network.
 double getFitness()
          Return the fitness value for this network.
static void main(java.lang.String[] args)
          DOCUMENT ME!
 Evolvable mate(Evolvable partner)
          Mate with another network.
 void mutate()
          Mutate this feedforward network.
 void randomInitialize()
          Randomly initialize the network.
 
Methods inherited from class org.jscience.computing.ai.neurocomputing.FeedForwardNN
initialize, run, setHiddenLayer, setInputLayer, setOutputLayer, train
 
Methods inherited from class org.jscience.computing.ai.neurocomputing.NeuralNetwork
getVisualization, render, setActivation, setVisualization, train, train, writeImage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fitnessValue

protected double fitnessValue
The fitness value for this feedforward network.


inputData

protected double[][] inputData
The input test data.

Constructor Detail

EvoFeedForwardNN

public EvoFeedForwardNN(int hidden)
Creates a new instance of EvoFeedForwardNN

Parameters:
hidden - the number of hidden layers.
Method Detail

main

public static void main(java.lang.String[] args)
DOCUMENT ME!

Parameters:
args - the command line arguments

calculateFitness

public void calculateFitness()
Calculate the fitness for this network. This is defined as the difference between the actual and desired output of the network.

Specified by:
calculateFitness in interface Evolvable

compareTo

public int compareTo(java.lang.Object o)
Compare to another feedforward network.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - the comparable object.
Returns:
-1, 0 or 1.

getFitness

public double getFitness()
Return the fitness value for this network.

Specified by:
getFitness in interface Evolvable
Returns:
the fitness value.

mate

public Evolvable mate(Evolvable partner)
Mate with another network.

Specified by:
mate in interface Evolvable
Parameters:
partner - the other parent network.
Returns:
the new child network.

mutate

public void mutate()
Mutate this feedforward network.

Specified by:
mutate in interface Evolvable

randomInitialize

public void randomInitialize()
Randomly initialize the network. The weights within the feedforward are randomly initialized.

Specified by:
randomInitialize in interface Evolvable