org.encog.ml.train.strategy
Class StopTrainingStrategy
- java.lang.Object
-
- org.encog.ml.train.strategy.StopTrainingStrategy
-
- All Implemented Interfaces:
- EndTrainingStrategy, Strategy
public class StopTrainingStrategy extends java.lang.Object implements EndTrainingStrategy
This strategy will indicate once training is no longer improving the neural network by a specified amount, over a specified number of cycles. This allows the program to automatically determine when to stop training.
-
-
Field Summary
Fields Modifier and Type Field and Description static doubleDEFAULT_MIN_IMPROVEMENTThe default minimum improvement before training stops.static intDEFAULT_TOLERATE_CYCLESThe default number of cycles to tolerate.
-
Constructor Summary
Constructors Constructor and Description StopTrainingStrategy()Construct the strategy with default options.StopTrainingStrategy(double minImprovement, int toleratedCycles)Construct the strategy with the specified parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidinit(MLTrain train)Initialize this strategy.voidpostIteration()Called just after a training iteration.voidpreIteration()Called just before a training iteration.booleanshouldStop()
-
-
-
Field Detail
-
DEFAULT_MIN_IMPROVEMENT
public static final double DEFAULT_MIN_IMPROVEMENT
The default minimum improvement before training stops.- See Also:
- Constant Field Values
-
DEFAULT_TOLERATE_CYCLES
public static final int DEFAULT_TOLERATE_CYCLES
The default number of cycles to tolerate.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
StopTrainingStrategy
public StopTrainingStrategy()
Construct the strategy with default options.
-
StopTrainingStrategy
public StopTrainingStrategy(double minImprovement, int toleratedCycles)Construct the strategy with the specified parameters.- Parameters:
minImprovement- The minimum accepted improvement.toleratedCycles- The number of cycles to tolerate before stopping.
-
-
Method Detail
-
init
public void init(MLTrain train)
Initialize this strategy.
-
postIteration
public void postIteration()
Called just after a training iteration.- Specified by:
postIterationin interfaceStrategy
-
preIteration
public void preIteration()
Called just before a training iteration.- Specified by:
preIterationin interfaceStrategy
-
shouldStop
public boolean shouldStop()
- Specified by:
shouldStopin interfaceEndTrainingStrategy- Returns:
- True if training should stop.
-
-
DMelt 3.0 © DataMelt by jWork.ORG