org.encog.neural.networks.training.propagation
Class Propagation

java.lang.Object
  extended by org.encog.ml.train.BasicTraining
      extended by org.encog.neural.networks.training.propagation.Propagation
All Implemented Interfaces:
MLTrain, Train, MultiThreadable
Direct Known Subclasses:
Backpropagation, ManhattanPropagation, QuickPropagation, ResilientPropagation, ScaledConjugateGradient

public abstract class Propagation
extends BasicTraining
implements Train, MultiThreadable

Implements basic functionality that is needed by each of the propagation methods. The specifics of each of the propagation methods is implemented inside of the PropagationMethod interface implementors.

Author:
jheaton

Constructor Summary
Propagation(ContainsFlat network, MLDataSet training)
          Construct a propagation object.
 
Method Summary
 void finishTraining()
          Should be called after training has completed and the iteration method will not be called any further.
 void fixFlatSpot(boolean b)
          Default is true.
 FlatNetwork getCurrentFlatNetwork()
           
 TrainFlatNetwork getFlatTraining()
           
 MLMethod getMethod()
          Get the current best machine learning method from the training.
 int getThreadCount()
           
 void iteration()
          Perform one training iteration.
 void iteration(int count)
          Perform the specified number of training iterations.
 void setErrorFunction(ErrorFunction ef)
           
 void setFlatTraining(TrainFlatNetwork flatTraining)
           
 void setThreadCount(int numThreads)
          Set the number of threads.
 
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, canContinue, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, pause, resume, setError, setIteration
 

Constructor Detail

Propagation

public Propagation(ContainsFlat network,
                   MLDataSet training)
Construct a propagation object.

Parameters:
network - The network.
training - The training set.
Method Detail

finishTraining

public final void finishTraining()
Should be called after training has completed and the iteration method will not be called any further.

Specified by:
finishTraining in interface MLTrain
Overrides:
finishTraining in class BasicTraining

getCurrentFlatNetwork

public final FlatNetwork getCurrentFlatNetwork()
Returns:
the currentFlatNetwork

getFlatTraining

public final TrainFlatNetwork getFlatTraining()
Returns:
the flatTraining

getMethod

public final MLMethod getMethod()
Get the current best machine learning method from the training.

Specified by:
getMethod in interface MLTrain
Returns:
The best machine learningm method.

getThreadCount

public final int getThreadCount()
Specified by:
getThreadCount in interface MultiThreadable
Returns:
The number of threads.

iteration

public final void iteration()
Perform one training iteration.

Specified by:
iteration in interface MLTrain

iteration

public final void iteration(int count)
Perform the specified number of training iterations. This can be more efficient than single training iterations. This is particularly true if you are training with a GPU.

Specified by:
iteration in interface MLTrain
Overrides:
iteration in class BasicTraining
Parameters:
count - The number of training iterations.

setFlatTraining

public final void setFlatTraining(TrainFlatNetwork flatTraining)
Parameters:
flatTraining - the flatTraining to set

setThreadCount

public final void setThreadCount(int numThreads)
Set the number of threads. Specify zero to tell Encog to automatically determine the best number of threads for the processor. If OpenCL is used as the target device, then this value is not used.

Specified by:
setThreadCount in interface MultiThreadable
Parameters:
numThreads - The number of threads.

fixFlatSpot

public void fixFlatSpot(boolean b)
Default is true. Call this with false to disable flat spot fix. For more info on flat spot: http://www.heatonresearch.com/wiki/Flat_Spot

Parameters:
b - True to fix flat spots, false otherwise.

setErrorFunction

public void setErrorFunction(ErrorFunction ef)


Copyright © 2011. All Rights Reserved.