com.huguesjohnson.jail.neuralNetwork
Class BackPropagationNetwork

java.lang.Object
  |
  +--com.huguesjohnson.jail.neuralNetwork.NeuralNetwork
        |
        +--com.huguesjohnson.jail.neuralNetwork.BackPropagationNetwork
All Implemented Interfaces:
java.lang.Runnable, java.io.Serializable

public class BackPropagationNetwork
extends NeuralNetwork

BackPropagationNetwork

See Also:
Serialized Form

Constructor Summary
BackPropagationNetwork(int inputLayerSize, int hiddenLayerSize, int outputLayerSize, int inputSize, double punishRate, double rewardRate, double errorThreshold, double minWeight, double maxWeight)
          constructor
 
Method Summary
 double[] getDesiredOutput()
          returns the desired output of the network
 double getError()
          returns the error of the network
 com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer getHiddenLayer()
          returns the hidden layer
 com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer getInputLayer()
          returns the input layer
 double[] getOutput()
          returns the output of the network
 com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer getOutputLayer()
          returns the output layer
 void networkRunComplete()
          method invoked when the network run is complete
 void run()
          run the network
 void setDesiredOutput(double[] desiredOutput)
          sets the desired output of the network
 void setHiddenLayer(com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer hiddenLayer)
          sets the hidden layer, automatically adjusts links between input layer and hidden layer and hidden layer and output layer
 void setInput(double[] input)
          sets the input of the network
 void setInputLayer(com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer inputLayer)
          sets the input layer, automatically adjusts links between input layer and hidden layer
 void setOutputLayer(com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer outputLayer)
          sets the output layer, automatically adjusts links between hidden layer and output layer
 void train(int iterations)
          train the network
 
Methods inherited from class com.huguesjohnson.jail.neuralNetwork.NeuralNetwork
finalize, log, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BackPropagationNetwork

public BackPropagationNetwork(int inputLayerSize,
                              int hiddenLayerSize,
                              int outputLayerSize,
                              int inputSize,
                              double punishRate,
                              double rewardRate,
                              double errorThreshold,
                              double minWeight,
                              double maxWeight)
constructor

Parameters:
inputLayerSize - the number of neurons in the input layer
hiddenLayerSize - the number of neurons in the hidden layer
outputLayerSize - the number of neurons in the output layer
inputSize - the number of inputs to the layer
punishRate - the punish rate for every neuron in the layer
rewardRate - the reward rate for every neuron in the layer
errorThreshold - the error threshold for every neuron in the layer
minWeight - minimum weight on a neuron link
maxWeight - maximum weight on a neuron link
Method Detail

getOutput

public double[] getOutput()
returns the output of the network

Specified by:
getOutput in class NeuralNetwork
Returns:
output of the network

getError

public double getError()
returns the error of the network

Specified by:
getError in class NeuralNetwork
Returns:
error of the network

setDesiredOutput

public void setDesiredOutput(double[] desiredOutput)
sets the desired output of the network

Specified by:
setDesiredOutput in class NeuralNetwork
Parameters:
desiredOutput - the desired output of the network

setInput

public void setInput(double[] input)
sets the input of the network

Specified by:
setInput in class NeuralNetwork
Parameters:
input - the input of the network

getInputLayer

public final com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer getInputLayer()
returns the input layer

Returns:
input layer

getHiddenLayer

public final com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer getHiddenLayer()
returns the hidden layer

Returns:
hidden layer

getOutputLayer

public final com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer getOutputLayer()
returns the output layer

Returns:
output layer

setInputLayer

public final void setInputLayer(com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer inputLayer)
sets the input layer, automatically adjusts links between input layer and hidden layer

Parameters:
inputLayer - new input layer

setHiddenLayer

public final void setHiddenLayer(com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer hiddenLayer)
sets the hidden layer, automatically adjusts links between input layer and hidden layer and hidden layer and output layer

Parameters:
hiddenLayer - new hidden layer

setOutputLayer

public final void setOutputLayer(com.huguesjohnson.jail.neuralNetwork.BackPropagationLayer outputLayer)
sets the output layer, automatically adjusts links between hidden layer and output layer

Parameters:
outputLayer - new output layer

train

public void train(int iterations)
train the network

Specified by:
train in class NeuralNetwork
Parameters:
iterations - number of training iterations to run

run

public void run()
run the network

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class NeuralNetwork

networkRunComplete

public void networkRunComplete()
method invoked when the network run is complete


getDesiredOutput

public double[] getDesiredOutput()
returns the desired output of the network

Returns:
desired output of the network