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

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

public abstract class Propagation
extends BasicTraining

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(BasicNetwork network, NeuralDataSet training)
          Construct a propagation object.
 
Method Summary
 boolean canContinue()
           
 void finishTraining()
          Should be called after training has completed and the iteration method will not be called any further.
 FlatNetwork getCurrentFlatNetwork()
           
 TrainFlatNetwork getFlatTraining()
           
 BasicNetwork getNetwork()
          Get the current best network from the training.
 int getNumThreads()
           
 OpenCLTrainingProfile getProfile()
           
 boolean isValidResume(TrainingContinuation state)
          Determine if this specified training continuation object is valid for this training method.
 void iteration()
          Perform one training iteration.
 void iteration(int count)
          Perform the specified number of training iterations.
 TrainingContinuation pause()
          Pause the training to continue later.
 void resume(TrainingContinuation state)
          Resume training.
 void setFlatTraining(TrainFlatNetwork flatTraining)
           
 void setNumThreads(int numThreads)
          Set the number of threads.
 
Methods inherited from class org.encog.neural.networks.training.BasicTraining
addStrategy, getCloud, getError, getIteration, getStrategies, getTraining, isTrainingDone, postIteration, preIteration, setCloud, setError, setIteration, setTraining
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Propagation

public Propagation(BasicNetwork network,
                   NeuralDataSet training)
Construct a propagation object.

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

canContinue

public boolean canContinue()
Returns:
True if this training can be continued.

finishTraining

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

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

getCurrentFlatNetwork

public FlatNetwork getCurrentFlatNetwork()
Returns:
the currentFlatNetwork

getFlatTraining

public TrainFlatNetwork getFlatTraining()
Returns:
the flatTraining

getNetwork

public BasicNetwork getNetwork()
Description copied from interface: Train
Get the current best network from the training.

Returns:
The network.

getNumThreads

public int getNumThreads()
Returns:
The number of threads.

getProfile

public OpenCLTrainingProfile getProfile()
Returns:
The OpenCL device to use, or null for the CPU.

isValidResume

public boolean isValidResume(TrainingContinuation state)
Determine if this specified training continuation object is valid for this training method.

Parameters:
state - The training continuation object to check.
Returns:
True if the continuation object is valid.

iteration

public void iteration()
Perform one training iteration.


iteration

public 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 Train
Overrides:
iteration in class BasicTraining
Parameters:
count - The number of training iterations.

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.

setFlatTraining

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

setNumThreads

public void setNumThreads(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.

Parameters:
numThreads - The number of threads.


Copyright © 2011. All Rights Reserved.