org.jscience.computing.ai.neurocomputing
Class FeedForwardNN

java.lang.Object
  extended by org.jscience.computing.ai.neurocomputing.NeuralNetwork
      extended by org.jscience.computing.ai.neurocomputing.FeedForwardNN
All Implemented Interfaces:
Visualizable
Direct Known Subclasses:
EvoFeedForwardNN

public class FeedForwardNN
extends NeuralNetwork

A simple implementation of a feedforward network.


Field Summary
protected  FFNLayer[] nnLayers
          The layers in this network.
protected  int numLayers
          The number of layers in the feedforward network.
 
Fields inherited from class org.jscience.computing.ai.neurocomputing.NeuralNetwork
activation, visualization
 
Constructor Summary
FeedForwardNN(int hiddenLayers)
          Creates a new instance of FeedForwardNN
 
Method Summary
 void initialize()
          Initialize the network.
static void main(java.lang.String[] args)
          DOCUMENT ME!
 double run(double[] inputData)
          Run the network with the given inputs.
 void setHiddenLayer(FFNLayer hidden, int layer)
          Set the given hidden layer.
 void setInputLayer(FFNInputLayer input)
          Set the input layer for the network.
 void setOutputLayer(FFNLayer output)
          Set the output layer.
 double train(double[] inputData, double[] outputData)
          This class does not implement a training algorithm.
 
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

numLayers

protected int numLayers
The number of layers in the feedforward network.


nnLayers

protected FFNLayer[] nnLayers
The layers in this network.

Constructor Detail

FeedForwardNN

public FeedForwardNN(int hiddenLayers)
Creates a new instance of FeedForwardNN

Parameters:
hiddenLayers - the number of hidden layers to be in this network.
Method Detail

setInputLayer

public void setInputLayer(FFNInputLayer input)
Set the input layer for the network.

Parameters:
input - the input layer.

setHiddenLayer

public void setHiddenLayer(FFNLayer hidden,
                           int layer)
Set the given hidden layer.

Parameters:
hidden - the hidden layer.
layer - the layer index.
Throws:
java.lang.IllegalArgumentException - DOCUMENT ME!

setOutputLayer

public void setOutputLayer(FFNLayer output)
Set the output layer.

Parameters:
output - the output layer.

initialize

public void initialize()
                throws NeuralNetworkException
Initialize the network. This method verifies that all layers have been added, and automatically connects each layer to the next.

Specified by:
initialize in class NeuralNetwork
Throws:
NeuralNetworkException - an exception is thrown if a layer is missing.

run

public double run(double[] inputData)
           throws NeuralNetworkException
Run the network with the given inputs.

Specified by:
run in class NeuralNetwork
Parameters:
inputData - the inputs.
Returns:
the output of the feedforward network.
Throws:
NeuralNetworkException - unused.

train

public double train(double[] inputData,
                    double[] outputData)
This class does not implement a training algorithm.

Specified by:
train in class NeuralNetwork
Parameters:
inputData - unused.
outputData - unused.
Returns:
-1.

main

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

Parameters:
args - the command line arguments