org.encog.neural.networks.training.propagation.manhattan
Class ManhattanPropagation
- java.lang.Object
-
- org.encog.ml.train.BasicTraining
-
- org.encog.neural.networks.training.propagation.Propagation
-
- org.encog.neural.networks.training.propagation.manhattan.ManhattanPropagation
-
- All Implemented Interfaces:
- MLTrain, BatchSize, LearningRate, GradientWorkerOwner, Train, MultiThreadable
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.
-
-
Constructor Summary
Constructors Constructor and Description ManhattanPropagation(ContainsFlat network, MLDataSet training, double theLearnRate)Construct a Manhattan propagation training object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanContinue()This training type does not support training continue.doublegetLearningRate()voidinitOthers()Perform training method specific init.TrainingContinuationpause()This training type does not support training continue.voidresume(TrainingContinuation state)This training type does not support training continue.voidsetBatchSize(int theBatchSize)Do not allow batch sizes other than 0, not supported.voidsetLearningRate(double rate)Set the learning rate.doubleupdateWeight(double[] gradients, double[] lastGradient, int index)Calculate the amount to change the weight by.doubleupdateWeight(double[] gradients, double[] lastGradient, int index, double dropoutRate)Calculate the amount to change the weight by using dropout.-
Methods inherited from class org.encog.neural.networks.training.propagation.Propagation
calculateGradients, finishTraining, finishTraining, fixFlatSpot, getBatchSize, getCurrentFlatNetwork, getDropoutRate, getL1, getL2, getLastGradient, getMethod, getThreadCount, iteration, iteration, report, rollIteration, setDroupoutRate, setErrorFunction, setL1, setL2, setThreadCount
-
Methods inherited from class org.encog.ml.train.BasicTraining
addStrategy, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, postIteration, preIteration, setError, setIteration, setTraining
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.encog.ml.train.MLTrain
addStrategy, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, setError, setIteration
-
-
-
-
Constructor Detail
-
ManhattanPropagation
public ManhattanPropagation(ContainsFlat network, MLDataSet training, double theLearnRate)
Construct a Manhattan propagation training object.- Parameters:
network- The network to train.training- The training data to use.theLearnRate- The learning rate.
-
-
Method Detail
-
getLearningRate
public double getLearningRate()
- Specified by:
getLearningRatein interfaceLearningRate- Returns:
- The learning rate that was specified in the constructor.
-
setLearningRate
public void setLearningRate(double rate)
Set the learning rate.- Specified by:
setLearningRatein interfaceLearningRate- Parameters:
rate- The new learning rate.
-
canContinue
public boolean canContinue()
This training type does not support training continue.- Specified by:
canContinuein interfaceMLTrain- Returns:
- Always returns false.
-
pause
public TrainingContinuation pause()
This training type does not support training continue.
-
resume
public void resume(TrainingContinuation state)
This training type does not support training continue.
-
updateWeight
public double updateWeight(double[] gradients, double[] lastGradient, int index)Calculate the amount to change the weight by.- Specified by:
updateWeightin classPropagation- Parameters:
gradients- The gradients.lastGradient- The last gradients.index- The index to update.- Returns:
- The amount to change the weight by.
-
updateWeight
public double updateWeight(double[] gradients, double[] lastGradient, int index, double dropoutRate)Calculate the amount to change the weight by using dropout.- Specified by:
updateWeightin classPropagation- Parameters:
gradients- The gradients.lastGradient- The last gradients.index- The index to update.dropoutRate- The dropout rate.- Returns:
- The amount to change the weight by.
-
initOthers
public void initOthers()
Perform training method specific init.- Specified by:
initOthersin classPropagation
-
setBatchSize
public void setBatchSize(int theBatchSize)
Do not allow batch sizes other than 0, not supported.- Specified by:
setBatchSizein interfaceBatchSize- Overrides:
setBatchSizein classPropagation- Parameters:
theBatchSize- The batch size.
-
-
DMelt 3.0 © DataMelt by jWork.ORG