neural.net
Class BackPropagator

java.lang.Object
  extended by neural.net.BackPropagator
All Implemented Interfaces:
java.io.Serializable

public class BackPropagator
extends java.lang.Object
implements java.io.Serializable

This class performs back-propagation on a Network to update/train the weights of the Neurons within each Layer in the Network

Version:
1.0.0
Author:
Jonathan Reimels
See Also:
Serialized Form

Constructor Summary
BackPropagator(Network network, double learningRate)
          Constructor
 
Method Summary
 void addInputOutput(double[] inputs, double[] expectedOutputs)
          Add an input and the expected output for this input
 java.util.ArrayList<java.lang.Double> getAverageErrors()
          The averages from each input within the last run
 double runAndUpdate()
          Run the input through an iteration, and update the weights of each neuron after the run of each input
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BackPropagator

public BackPropagator(Network network,
                      double learningRate)
Constructor

Parameters:
network - - The Network to operate on
learningRate - - The learning rate to use (should be between 0 and 1)
Method Detail

getAverageErrors

public java.util.ArrayList<java.lang.Double> getAverageErrors()
The averages from each input within the last run

Returns:
averages

addInputOutput

public void addInputOutput(double[] inputs,
                           double[] expectedOutputs)
                    throws java.lang.Exception
Add an input and the expected output for this input

Parameters:
inputs - - input to use
expectedOutputs - - output expected from this input
Throws:
java.lang.Exception - - throws an exception if the input size doesn't match that expected by the Network, or the output size doesn't match that returned by the Network

runAndUpdate

public double runAndUpdate()
                    throws java.lang.Exception
Run the input through an iteration, and update the weights of each neuron after the run of each input

Returns:
average error across running all inputs
Throws:
java.lang.Exception