org.encog.neural.networks.training.nm
Class NelderMeadTraining

java.lang.Object
  extended by org.encog.ml.train.BasicTraining
      extended by 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
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
 boolean canContinue()
          
 double fn(double[] weights)
          Calculate the error for the neural network with a given set of weights.
 MLMethod getMethod()
          Get the current best machine learning method from the training.
 boolean isTrainingDone()
          
 void iteration()
          Perform one iteration of training.
 TrainingContinuation pause()
          Pause the training to continue later.
 void resume(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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 learningm method.

isTrainingDone

public boolean isTrainingDone()

Specified by:
isTrainingDone in interface MLTrain
Overrides:
isTrainingDone in class BasicTraining
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.


Copyright © 2014. All Rights Reserved.