|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.encog.ml.train.BasicTraining
org.encog.neural.networks.training.propagation.Propagation
org.encog.neural.networks.training.propagation.manhattan.ManhattanPropagation
public class ManhattanPropagation
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.
Field Summary |
---|
Fields inherited from class org.encog.neural.networks.training.propagation.Propagation |
---|
gradients, lastError, network |
Constructor Summary | |
---|---|
ManhattanPropagation(ContainsFlat network,
MLDataSet training,
double theLearnRate)
Construct a Manhattan propagation training object. |
Method Summary | |
---|---|
boolean |
canContinue()
This training type does not support training continue. |
double |
getLearningRate()
|
void |
initOthers()
Perform training method specific init. |
TrainingContinuation |
pause()
This training type does not support training continue. |
void |
resume(TrainingContinuation state)
This training type does not support training continue. |
void |
setBatchSize(int theBatchSize)
Do not allow batch sizes other than 0, not supported. |
void |
setLearningRate(double rate)
Set the learning rate. |
double |
updateWeight(double[] gradients,
double[] lastGradient,
int index)
Calculate the amount to change the weight by. |
Methods inherited from class org.encog.neural.networks.training.propagation.Propagation |
---|
calculateGradients, finishTraining, fixFlatSpot, getBatchSize, getCurrentFlatNetwork, getLastGradient, getMethod, getThreadCount, iteration, iteration, learn, learnLimited, report, rollIteration, setErrorFunction, 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 |
---|
clone, equals, finalize, 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 |
---|
public ManhattanPropagation(ContainsFlat network, MLDataSet training, double theLearnRate)
network
- The network to train.training
- The training data to use.theLearnRate
- The learning rate.Method Detail |
---|
public double getLearningRate()
getLearningRate
in interface LearningRate
public void setLearningRate(double rate)
setLearningRate
in interface LearningRate
rate
- The new learning rate.public boolean canContinue()
canContinue
in interface MLTrain
public TrainingContinuation pause()
pause
in interface MLTrain
public void resume(TrainingContinuation state)
resume
in interface MLTrain
state
- Not used.public double updateWeight(double[] gradients, double[] lastGradient, int index)
updateWeight
in class Propagation
gradients
- The gradients.lastGradient
- The last gradients.index
- The index to update.
public void initOthers()
initOthers
in class Propagation
public void setBatchSize(int theBatchSize)
setBatchSize
in interface BatchSize
setBatchSize
in class Propagation
theBatchSize
- The batch size.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |