The Encog Project

org.encog.neural.networks.training
Class BasicTraining

java.lang.Object
  extended by org.encog.neural.networks.training.BasicTraining
All Implemented Interfaces:
Train
Direct Known Subclasses:
CompetitiveTraining, MultiPropagation, NeuralGeneticAlgorithm, NeuralSimulatedAnnealing, Propagation, TrainAdaline, TrainInstar, TrainOutstar

public abstract class BasicTraining
extends java.lang.Object
implements Train

An abstract class that implements basic training for most training algorithms. Specifically training strategies can be added to enhance the training.

Author:
jheaton

Constructor Summary
BasicTraining()
           
 
Method Summary
 void addStrategy(Strategy strategy)
          Training strategies can be added to improve the training results.
 void finishTraining()
          Should be called after training has completed and the iteration method will not be called any further.
 double getError()
          Get the current error percent from the training.
 java.util.List<Strategy> getStrategies()
           
 NeuralDataSet getTraining()
           
 void postIteration()
          Call the strategies after an iteration.
 void preIteration()
          Call the strategies before an iteration.
 void setError(double error)
           
 void setTraining(NeuralDataSet training)
          Set the training object that this strategy is working with.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.encog.neural.networks.training.Train
getNetwork, iteration
 

Constructor Detail

BasicTraining

public BasicTraining()
Method Detail

addStrategy

public void addStrategy(Strategy strategy)
Training strategies can be added to improve the training results. There are a number to choose from, and several can be used at once.

Specified by:
addStrategy in interface Train
Parameters:
strategy - The strategy to add.

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

getError

public double getError()
Get the current error percent from the training.

Specified by:
getError in interface Train
Returns:
The current error.

getStrategies

public java.util.List<Strategy> getStrategies()
Specified by:
getStrategies in interface Train
Returns:
The strategies to use.

getTraining

public NeuralDataSet getTraining()
Specified by:
getTraining in interface Train
Returns:
The training data to use.

postIteration

public void postIteration()
Call the strategies after an iteration.


preIteration

public void preIteration()
Call the strategies before an iteration.


setError

public void setError(double error)
Specified by:
setError in interface Train
Parameters:
error - Set the current error rate. This is usually used by training strategies.

setTraining

public void setTraining(NeuralDataSet training)
Set the training object that this strategy is working with.

Parameters:
training - The training object.

The Encog Project