org.encog.neural.freeform.training
Class FreeformPropagationTraining
- java.lang.Object
-
- org.encog.ml.train.BasicTraining
-
- org.encog.neural.freeform.training.FreeformPropagationTraining
-
- All Implemented Interfaces:
- java.io.Serializable, MLTrain
- Direct Known Subclasses:
- FreeformBackPropagation, FreeformResilientPropagation
public abstract class FreeformPropagationTraining extends BasicTraining implements java.io.Serializable
Provides basic propagation functions to other trainers.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleFLAT_SPOT_CONSTThe constant to use to fix the flat spot problem.
-
Constructor Summary
Constructors Constructor and Description FreeformPropagationTraining()Don't use this constructor, it is for serialization only.FreeformPropagationTraining(FreeformNetwork theNetwork, MLDataSet theTraining)Construct the trainer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanContinue()voidfinishTraining()Should be called after training has completed and the iteration method will not be called any further.intgetBatchSize()doublegetError()TrainingImplementationTypegetImplementationType()intgetIteration()MLMethodgetMethod()Get the current best machine learning method from the training.MLDataSetgetTraining()booleanisFixFlatSopt()voiditeration()Perform one iteration of training.voiditeration(int count)Perform the specified number of training iterations.voidsetBatchSize(int batchSize)Set the batch size.voidsetError(double theError)voidsetFixFlatSopt(boolean fixFlatSopt)Set if we should fix the flat spot problem.voidsetIteration(int iteration)Set the current training iteration.-
Methods inherited from class org.encog.ml.train.BasicTraining
addStrategy, getStrategies, isTrainingDone, postIteration, preIteration, setTraining
-
-
-
-
Field Detail
-
FLAT_SPOT_CONST
public static final double FLAT_SPOT_CONST
The constant to use to fix the flat spot problem.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FreeformPropagationTraining
public FreeformPropagationTraining()
Don't use this constructor, it is for serialization only.
-
FreeformPropagationTraining
public FreeformPropagationTraining(FreeformNetwork theNetwork, MLDataSet theTraining)
Construct the trainer.- Parameters:
theNetwork- The network to train.theTraining- The training data.
-
-
Method Detail
-
canContinue
public boolean canContinue()
- Specified by:
canContinuein interfaceMLTrain- Returns:
- True if the training can be paused, and later continued.
-
finishTraining
public void finishTraining()
Should be called after training has completed and the iteration method will not be called any further.- Specified by:
finishTrainingin interfaceMLTrain- Overrides:
finishTrainingin classBasicTraining
-
getError
public double getError()
- Specified by:
getErrorin interfaceMLTrain- Overrides:
getErrorin classBasicTraining- Returns:
- Returns the training error. This value is calculated as the training data is evaluated by the iteration function. This has two important ramifications. First, the value returned by getError() is meaningless prior to a call to iteration. Secondly, the error is calculated BEFORE training is applied by the call to iteration. The timing of the error calculation is done for performance reasons.
-
getImplementationType
public TrainingImplementationType getImplementationType()
- Specified by:
getImplementationTypein interfaceMLTrain- Overrides:
getImplementationTypein classBasicTraining- Returns:
- The training implementation type.
-
getIteration
public int getIteration()
- Specified by:
getIterationin interfaceMLTrain- Overrides:
getIterationin classBasicTraining- Returns:
- the iteration
-
getMethod
public MLMethod getMethod()
Get the current best machine learning method from the training.
-
getTraining
public MLDataSet getTraining()
- Specified by:
getTrainingin interfaceMLTrain- Overrides:
getTrainingin classBasicTraining- Returns:
- The training data to use.
-
isFixFlatSopt
public boolean isFixFlatSopt()
- Returns:
- True, if we are fixing the flat spot problem.
-
iteration
public void iteration()
Perform one iteration of training.
-
iteration
public void iteration(int count)
Perform the specified number of training iterations. This is a basic implementation that just calls iteration the specified number of times. However, some training methods, particularly with the GPU, benefit greatly by calling with higher numbers than 1.- Specified by:
iterationin interfaceMLTrain- Overrides:
iterationin classBasicTraining- Parameters:
count- The number of training iterations.
-
setError
public void setError(double theError)
- Specified by:
setErrorin interfaceMLTrain- Overrides:
setErrorin classBasicTraining- Parameters:
theError- Set the current error rate. This is usually used by training strategies.
-
setFixFlatSopt
public void setFixFlatSopt(boolean fixFlatSopt)
Set if we should fix the flat spot problem.- Parameters:
fixFlatSopt- True, if we should fix the flat spot problem.
-
setIteration
public void setIteration(int iteration)
Set the current training iteration.- Specified by:
setIterationin interfaceMLTrain- Overrides:
setIterationin classBasicTraining- Parameters:
iteration- the iteration to set
-
getBatchSize
public int getBatchSize()
- Returns:
- The batch size.
-
setBatchSize
public void setBatchSize(int batchSize)
Set the batch size.- Parameters:
batchSize- The batch size.
-
-
DMelt 3.0 © DataMelt by jWork.ORG