org.encog.neural.flat.train.prop
Class TrainFlatNetworkQPROP

java.lang.Object
  extended by org.encog.neural.flat.train.prop.TrainFlatNetworkProp
      extended by org.encog.neural.flat.train.prop.TrainFlatNetworkQPROP
All Implemented Interfaces:
TrainFlatNetwork

public class TrainFlatNetworkQPROP
extends TrainFlatNetworkProp

Train a flat network, using QuickPropagation. Code in this file is based on work done by An Empirical Study of Learning Speed in Back-Propagation Networks" (Scott E. Fahlman, 1988)


Field Summary
 
Fields inherited from class org.encog.neural.flat.train.prop.TrainFlatNetworkProp
currentError, gradients, lastError, network
 
Constructor Summary
TrainFlatNetworkQPROP(FlatNetwork network, MLDataSet training, double theLearningRate)
          Construct a QPROP trainer for flat networks.
 
Method Summary
 double getDecay()
           
 double getEps()
           
 double[] getLastDelta()
           
 double getLearningRate()
           
 double getOutputEpsilon()
           
 double getShrink()
           
 void initOthers()
          Perform training method specific init.
 void setDecay(double decay)
           
 void setLastDelta(double[] lastDelta)
           
 void setLearningRate(double rate)
          Set the learning rate.
 void setOutputEpsilon(double outputEpsilon)
           
 void setShrink(double shrink)
           
 double updateWeight(double[] gradients, double[] lastGradient, int index)
          Update a weight.
 
Methods inherited from class org.encog.neural.flat.train.prop.TrainFlatNetworkProp
calculateGradients, finishTraining, fixFlatSpot, getError, getErrorFunction, getIteration, getLastGradient, getNetwork, getNumThreads, getTraining, iteration, iteration, learn, learnLimited, report, setErrorFunction, setIteration, setNumThreads
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TrainFlatNetworkQPROP

public TrainFlatNetworkQPROP(FlatNetwork network,
                             MLDataSet training,
                             double theLearningRate)
Construct a QPROP trainer for flat networks.

Parameters:
network - The network to train.
training - The training data.
theLearningRate - The learning rate. 2 is a good suggestion as a learning rate to start with. If it fails to converge, then drop it. Just like backprop, except QPROP can take higher learning rates.
Method Detail

initOthers

public void initOthers()
Perform training method specific init.

Specified by:
initOthers in class TrainFlatNetworkProp

getLearningRate

public final double getLearningRate()
Returns:
the learningRate

setLearningRate

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

Parameters:
rate - The learning rate.

updateWeight

public final double updateWeight(double[] gradients,
                                 double[] lastGradient,
                                 int index)
Update a weight.

Specified by:
updateWeight in class TrainFlatNetworkProp
Parameters:
gradients - The gradients.
lastGradient - The last gradients.
index - The index.
Returns:
The weight delta.

getDecay

public double getDecay()
Returns:
the decay

getOutputEpsilon

public double getOutputEpsilon()
Returns:
the outputEpsilon

getShrink

public double getShrink()
Returns:
the shrink

setShrink

public void setShrink(double shrink)
Parameters:
shrink - the shrink to set

setOutputEpsilon

public void setOutputEpsilon(double outputEpsilon)
Parameters:
outputEpsilon - the outputEpsilon to set

getLastDelta

public double[] getLastDelta()
Returns:
the lastDelta

setLastDelta

public void setLastDelta(double[] lastDelta)
Parameters:
lastDelta - the lastDelta to set

getEps

public double getEps()
Returns:
the eps

setDecay

public void setDecay(double decay)
Parameters:
decay - the decay to set


Copyright © 2011. All Rights Reserved.