org.encog.neural.networks.training.nm
Class NelderMeadTraining
- java.lang.Object
-
- org.encog.ml.train.BasicTraining
-
- org.encog.neural.networks.training.nm.NelderMeadTraining
-
- All Implemented Interfaces:
- MLTrain
public class NelderMeadTraining extends BasicTraining
The Nelder-Mead method is a commonly used parameter optimization method that can be used for neural network training. It typically provides a good error rate and is relatively fast. Nelder-Mead must build a simplex, which is an n*(n+1) matrix of weights. If you have a large number of weights, this matrix can quickly overflow memory. The biggest enhancement that is needed for this trainer is to make use of multi-threaded code to evaluate the speed evaluations when training on a multi-core. This implementation is based on the source code provided by John Burkardt (http://people.sc.fsu.edu/~jburkardt/) http://people.sc.fsu.edu/~jburkardt/c_src/asa047/asa047.c
-
-
Constructor Summary
Constructors Constructor and Description NelderMeadTraining(BasicNetwork network, MLDataSet training)Construct a Nelder Mead trainer with a step size of 100.NelderMeadTraining(BasicNetwork network, MLDataSet training, double stepValue)Construct a Nelder Mead trainer with a definable step.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanContinue()doublefn(double[] weights)Calculate the error for the neural network with a given set of weights.MLMethodgetMethod()Get the current best machine learning method from the training.booleanisTrainingDone()voiditeration()Perform one iteration of training.TrainingContinuationpause()Pause the training to continue later.voidresume(TrainingContinuation state)Resume training.-
Methods inherited from class org.encog.ml.train.BasicTraining
addStrategy, finishTraining, getError, getImplementationType, getIteration, getStrategies, getTraining, iteration, postIteration, preIteration, setError, setIteration, setTraining
-
-
-
-
Constructor Detail
-
NelderMeadTraining
public NelderMeadTraining(BasicNetwork network, MLDataSet training)
Construct a Nelder Mead trainer with a step size of 100.- Parameters:
network- The network to train.training- The training set to use.
-
NelderMeadTraining
public NelderMeadTraining(BasicNetwork network, MLDataSet training, double stepValue)
Construct a Nelder Mead trainer with a definable step.- Parameters:
network- The network to train.training- The training data to use.stepValue- The step value. This value defines, to some degree the range of different weights that will be tried.
-
-
Method Detail
-
canContinue
public boolean canContinue()
- Returns:
- True if the training can be paused, and later continued.
-
fn
public double fn(double[] weights)
Calculate the error for the neural network with a given set of weights.- Parameters:
weights- The weights to use.- Returns:
- The current error.
-
getMethod
public MLMethod getMethod()
Get the current best machine learning method from the training.- Returns:
- The best machine learning method.
-
isTrainingDone
public boolean isTrainingDone()
- Specified by:
isTrainingDonein interfaceMLTrain- Overrides:
isTrainingDonein classBasicTraining- Returns:
- True if training can progress no further.
-
iteration
public void iteration()
Perform one iteration of training.
-
pause
public TrainingContinuation pause()
Pause the training to continue later.- Returns:
- A training continuation object.
-
resume
public void resume(TrainingContinuation state)
Resume training.- Parameters:
state- The training continuation object to use to continue.
-
-
DMelt 3.0 © DataMelt by jWork.ORG