The Encog Project

org.encog.neural.networks.training.propagation.manhattan
Class ManhattanPropagation

java.lang.Object
  extended by org.encog.neural.networks.training.BasicTraining
      extended by org.encog.neural.networks.training.propagation.Propagation
          extended by org.encog.neural.networks.training.propagation.manhattan.ManhattanPropagation
All Implemented Interfaces:
LearningRate, Train

public class ManhattanPropagation
extends Propagation
implements LearningRate

One problem that the backpropagation technique has is that the magnitude of the partial derivative may be calculated too large or too small. The Manhattan update algorithm attempts to solve this by using the partial derivative to only indicate the sign of the update to the weight matrix. The actual amount added or subtracted from the weight matrix is obtained from a simple constant. This constant must be adjusted based on the type of neural network being trained. In general, start with a higher constant and decrease it as needed. The Manhattan update algorithm can be thought of as a simplified version of the resilient algorithm. The resilient algorithm uses more complex techniques to determine the update value.

Author:
jheaton

Constructor Summary
ManhattanPropagation(BasicNetwork network, NeuralDataSet training, double learnRate)
          Construct a class to train with Manhattan propagation.
ManhattanPropagation(BasicNetwork network, NeuralDataSet training, double learnRate, double zeroTolerance)
          Construct a Manhattan propagation training object.
 
Method Summary
 double getLearningRate()
           
 double getZeroTolerance()
           
 void performIteration(CalculateGradient prop, double[] weights)
          Perform a training iteration.
 void setLearningRate(double rate)
          Set the learning rate.
 
Methods inherited from class org.encog.neural.networks.training.propagation.Propagation
canContinue, getNetwork, getNumThreads, isValidResume, iteration, pause, resume, setNumThreads
 
Methods inherited from class org.encog.neural.networks.training.BasicTraining
addStrategy, finishTraining, getError, getStrategies, getTraining, postIteration, preIteration, setError, setTraining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManhattanPropagation

public ManhattanPropagation(BasicNetwork network,
                            NeuralDataSet training,
                            double learnRate)
Construct a class to train with Manhattan propagation. Use default zero tolerance.

Parameters:
network - The network that is to be trained.
training - The training data to use.
learnRate - A fixed learning to the weight matrix for each training iteration.

ManhattanPropagation

public ManhattanPropagation(BasicNetwork network,
                            NeuralDataSet training,
                            double learnRate,
                            double zeroTolerance)
Construct a Manhattan propagation training object.

Parameters:
network - The network to train.
training - The training data to use.
learnRate - The learning rate.
zeroTolerance - The zero tolerance.
Method Detail

getLearningRate

public double getLearningRate()
Specified by:
getLearningRate in interface LearningRate
Returns:
The learning rate that was specified in the constructor.

getZeroTolerance

public double getZeroTolerance()
Returns:
The zero tolerance that was specified in the constructor.

performIteration

public void performIteration(CalculateGradient prop,
                             double[] weights)
Perform a training iteration. This is where the actual Manhattan specific training takes place.

Specified by:
performIteration in class Propagation
Parameters:
prop - The gradients.
weights - The network weights.

setLearningRate

public void setLearningRate(double rate)
Set the learning rate.

Specified by:
setLearningRate in interface LearningRate
Parameters:
rate - The new learning rate.

The Encog Project