org.encog.ml.train.strategy
Class HybridStrategy

java.lang.Object
  extended by org.encog.ml.train.strategy.HybridStrategy
All Implemented Interfaces:
Strategy

public class HybridStrategy
extends 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.

Author:
jheaton

Field Summary
static int DEFAULT_ALTERNATE_CYCLES
          The default number of cycles to use the alternate training for.
static double DEFAULT_MIN_IMPROVEMENT
          The default minimum improvement before we switch to the alternate training method.
static int DEFAULT_TOLERATE_CYCLES
          The default number of cycles to tolerate bad improvement for.
 
Constructor Summary
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
 void init(MLTrain train)
          Initialize this strategy.
 void postIteration()
          Called just after a training iteration.
 void preIteration()
          Called just before a training iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.

Specified by:
init in interface Strategy
Parameters:
train - The training algorithm.

postIteration

public void postIteration()
Called just after a training iteration.

Specified by:
postIteration in interface Strategy

preIteration

public void preIteration()
Called just before a training iteration.

Specified by:
preIteration in interface Strategy


Copyright © 2014. All Rights Reserved.