org.encog.ml.train.strategy
Class HybridStrategy
- java.lang.Object
-
- org.encog.ml.train.strategy.HybridStrategy
-
- All Implemented Interfaces:
- Strategy
public class HybridStrategy extends java.lang.Object implements Strategy
A hybrid stragey allows a secondary training algorithm to be used. Once the primary algorithm is no longer improving by much, the secondary will be used. Using simulated annealing in as a secondary to one of the propagation methods is often a very efficient combination as it can help the propagation method escape a local minimum. This is particularly true with backpropagation.
-
-
Field Summary
Fields Modifier and Type Field and Description static intDEFAULT_ALTERNATE_CYCLESThe default number of cycles to use the alternate training for.static doubleDEFAULT_MIN_IMPROVEMENTThe default minimum improvement before we switch to the alternate training method.static intDEFAULT_TOLERATE_CYCLESThe default number of cycles to tolerate bad improvement for.
-
Constructor Summary
Constructors Constructor and Description HybridStrategy(MLTrain altTrain)Construct a hybrid strategy with the default minimum improvement and toleration cycles.HybridStrategy(MLTrain altTrain, double minImprovement, int tolerateMinImprovement, int alternateCycles)Create a hybrid strategy.
-
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.
-
-
-
Field Detail
-
DEFAULT_MIN_IMPROVEMENT
public static final double DEFAULT_MIN_IMPROVEMENT
The default minimum improvement before we switch to the alternate training method.- See Also:
- Constant Field Values
-
DEFAULT_TOLERATE_CYCLES
public static final int DEFAULT_TOLERATE_CYCLES
The default number of cycles to tolerate bad improvement for.- See Also:
- Constant Field Values
-
DEFAULT_ALTERNATE_CYCLES
public static final int DEFAULT_ALTERNATE_CYCLES
The default number of cycles to use the alternate training for.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
HybridStrategy
public HybridStrategy(MLTrain altTrain)
Construct a hybrid strategy with the default minimum improvement and toleration cycles.- Parameters:
altTrain- The alternative training strategy.
-
HybridStrategy
public HybridStrategy(MLTrain altTrain, double minImprovement, int tolerateMinImprovement, int alternateCycles)
Create a hybrid strategy.- Parameters:
altTrain- The alternate training algorithm.minImprovement- The minimum improvement to switch algorithms.tolerateMinImprovement- The number of cycles to tolerate the minimum improvement for.alternateCycles- How many cycles should the alternate training algorithm be used for.
-
-
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
-
-
DMelt 3.0 © DataMelt by jWork.ORG