The Encog Project

org.encog.neural.networks.training.backpropagation
Class Backpropagation

java.lang.Object
  extended by org.encog.neural.networks.training.backpropagation.Backpropagation
All Implemented Interfaces:
Train

public class Backpropagation
extends java.lang.Object
implements Train

Backpropagation: This class implements a backpropagation training algorithm for feed forward neural networks. It is used in the same manner as any other training class that implements the Train interface. Backpropagation is a common neural network training algorithm. It works by analyzing the error of the output of the neural network. Each neuron in the output layer's contribution, according to weight, to this error is determined. These weights are then adjusted to minimize this error. This process continues working its way backwards through the layers of the neural network. This implementation of the backpropagation algorithm uses both momentum and a learning rate. The learning rate specifies the degree to which the weight matrixes will be modified through each iteration. The momentum specifies how much the previous learning iteration affects the current. To use no momentum at all specify zero.


Constructor Summary
Backpropagation(BasicNetwork network, NeuralDataSet training, double learnRate, double momentum)
          Construct a backpropagation trainer.
 
Method Summary
 void calcError(NeuralData ideal)
          Calculate the error for the recognition just done.
 BackpropagationLayer getBackpropagationLayer(Layer layer)
          Get the BackpropagationLayer that corresponds to the specified layer.
 double getError()
          Returns the root mean square error for a complete training set.
 BasicNetwork getNetwork()
          Get the current best neural network.
 void iteration()
          Perform one iteration of training.
 void learn()
          Modify the weight matrix and thresholds based on the last call to calcError.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Backpropagation

public Backpropagation(BasicNetwork network,
                       NeuralDataSet training,
                       double learnRate,
                       double momentum)
Construct a backpropagation trainer.

Parameters:
network - The network to train.
training - The training data to use.
learnRate - The rate at which the weight matrix will be adjusted based on learning.
momentum - The influence that previous iteration's training deltas will have on the current iteration.
Method Detail

calcError

public void calcError(NeuralData ideal)
Calculate the error for the recognition just done.

Parameters:
ideal - What the output neurons should have yielded.

getBackpropagationLayer

public BackpropagationLayer getBackpropagationLayer(Layer layer)
Get the BackpropagationLayer that corresponds to the specified layer.

Parameters:
layer - The specified layer.
Returns:
The BackpropagationLayer that corresponds to the specified layer.

getError

public double getError()
Returns the root mean square error for a complete training set.

Specified by:
getError in interface Train
Returns:
The current error for the neural network.

getNetwork

public BasicNetwork getNetwork()
Get the current best neural network.

Specified by:
getNetwork in interface Train
Returns:
The current best neural network.

iteration

public void iteration()
Perform one iteration of training.

Specified by:
iteration in interface Train

learn

public void learn()
Modify the weight matrix and thresholds based on the last call to calcError.


The Encog Project