|
||||||||||
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.back.Backpropagation
public class 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. One primary problem with backpropagation is that the magnitude of the partial derivative is often detrimental to the training of the neural network. The other propagation methods of Manhatten and Resilient address this issue in different ways. In general, it is suggested that you use the resilient propagation technique for most Encog training tasks over back propagation.
Field Summary | |
---|---|
static String |
LAST_DELTA
The resume key for backpropagation. |
Fields inherited from class org.encog.neural.networks.training.propagation.Propagation |
---|
gradients, lastError, network |
Constructor Summary | |
---|---|
Backpropagation(ContainsFlat network,
MLDataSet training)
Create a class to train using backpropagation. |
|
Backpropagation(ContainsFlat network,
MLDataSet training,
double theLearnRate,
double theMomentum)
|
Method Summary | |
---|---|
boolean |
canContinue()
|
double[] |
getLastDelta()
|
double |
getLearningRate()
|
double |
getMomentum()
|
void |
initOthers()
Perform training method specific init. |
boolean |
isValidResume(TrainingContinuation state)
Determine if the specified continuation object is valid to resume with. |
TrainingContinuation |
pause()
Pause the training. |
void |
resume(TrainingContinuation state)
Resume training. |
void |
setLearningRate(double rate)
Set the learning rate, this is value is essentially a percent. |
void |
setMomentum(double m)
Set the momentum for training. |
double |
updateWeight(double[] gradients,
double[] lastGradient,
int index)
Update a weight. |
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, setBatchSize, 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 |
Field Detail |
---|
public static final String LAST_DELTA
Constructor Detail |
---|
public Backpropagation(ContainsFlat network, MLDataSet training)
network
- The network that is to be trained.training
- The training data to be used for backpropagation.public Backpropagation(ContainsFlat network, MLDataSet training, double theLearnRate, double theMomentum)
network
- The network that is to be trainedtraining
- The training settheLearnRate
- The rate at which the weight matrix will be adjusted based on
learning.theMomentum
- The influence that previous iteration's training deltas will
have on the current iteration.Method Detail |
---|
public boolean canContinue()
canContinue
in interface MLTrain
public double[] getLastDelta()
public double getLearningRate()
getLearningRate
in interface LearningRate
public double getMomentum()
getMomentum
in interface Momentum
public boolean isValidResume(TrainingContinuation state)
state
- The continuation object to check.
public TrainingContinuation pause()
pause
in interface MLTrain
public void resume(TrainingContinuation state)
resume
in interface MLTrain
state
- The training state to return to.public void setLearningRate(double rate)
setLearningRate
in interface LearningRate
rate
- The learning rate.public void setMomentum(double m)
setMomentum
in interface Momentum
m
- The momentum.public double updateWeight(double[] gradients, double[] lastGradient, int index)
updateWeight
in class Propagation
gradients
- The gradients.lastGradient
- The last gradients.index
- The index.
public void initOthers()
initOthers
in class Propagation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |