|
||||||||||
| 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.lma.LevenbergMarquardtTraining
public class LevenbergMarquardtTraining
Trains a neural network using a Levenberg Marquardt algorithm (LMA). This training technique is based on the mathematical technique of the same name. http://en.wikipedia.org/wiki/Levenberg%E2%80%93Marquardt_algorithm The LMA training technique has some important limitations that you should be aware of, before using it. Only neural networks that have a single output neuron can be used with this training technique. The entire training set must be loaded into memory. Because of this an Indexable training set must be used. However, despite these limitations, the LMA training technique can be a very effective training method. References: - http://www-alg.ist.hokudai.ac.jp/~jan/alpha.pdf - http://www.inference.phy.cam.ac.uk/mackay/Bayes_FAQ.html ---------------------------------------------------------------- This implementation of the Levenberg Marquardt algorithm is based heavily on code published in an article by Cesar Roberto de Souza. The original article can be found here: http://crsouza.blogspot.com/2009/11/neural-network-learning-by-levenberg_18.html Portions of this class are under the following copyright/license. Copyright 2009 by Cesar Roberto de Souza, Released under the LGPL.
| Field Summary | |
|---|---|
static double |
LAMBDA_MAX
The max amount for the LAMBDA. |
static int |
NUM_POINTS
Number of points for finite difference. |
static double |
SCALE_LAMBDA
The amount to scale the lambda by. |
| Constructor Summary | |
|---|---|
LevenbergMarquardtTraining(BasicNetwork network,
MLDataSet training)
Construct the LMA object. |
|
| Method Summary | |
|---|---|
void |
calculateHessian()
Calculate the Hessian matrix. |
boolean |
canContinue()
|
MLMethod |
getMethod()
Get the current best machine learning method from the training. |
void |
iteration()
Perform one iteration. |
TrainingContinuation |
pause()
Pause the training to continue later. |
void |
resume(TrainingContinuation state)
Resume training. |
static double |
trace(double[][] m)
Return the sum of the diagonal. |
void |
updateWeights()
Update the weights. |
| Methods inherited from class org.encog.ml.train.BasicTraining |
|---|
addStrategy, finishTraining, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, iteration, postIteration, preIteration, setError, setIteration, setTraining |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double SCALE_LAMBDA
public static final double LAMBDA_MAX
public static final int NUM_POINTS
| Constructor Detail |
|---|
public LevenbergMarquardtTraining(BasicNetwork network,
MLDataSet training)
network - The network to train. Must have a single output neuron.training - The training data to use. Must be indexable.| Method Detail |
|---|
public static double trace(double[][] m)
m - The matrix to sum.
public void calculateHessian()
public boolean canContinue()
public MLMethod getMethod()
MLTrain
public void iteration()
public TrainingContinuation pause()
public void resume(TrainingContinuation state)
state - The training continuation object to use to continue.public void updateWeights()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||