calhoun.analysis.crf.solver
Class SeededOptimizer

java.lang.Object
  extended by calhoun.analysis.crf.solver.SeededOptimizer
All Implemented Interfaces:
CRFTraining

public class SeededOptimizer
extends java.lang.Object
implements CRFTraining

an optimizer that uses the weights from another model as the seed for a new optimization. Allows a second pass optimization on an already trained model.


Constructor Summary
SeededOptimizer()
           
 
Method Summary
 CRFTraining getSeededOptimizer()
           
 java.io.File getSeedModel()
           
 double[] optimize(ModelManager fm, java.util.List<? extends TrainingSequence<?>> data)
          find the set of weights which maximizes the value of the objective function.
 void setSeededOptimizer(CRFTraining seededOptimizer)
           
 void setSeedModel(java.io.File seedModel)
           
 void setStarts(double[] weights)
          starting weights are ignored for a SeededOptimizer, since they are always taken from the seeded model.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeededOptimizer

public SeededOptimizer()
Method Detail

optimize

public double[] optimize(ModelManager fm,
                         java.util.List<? extends TrainingSequence<?>> data)
Description copied from interface: CRFTraining
find the set of weights which maximizes the value of the objective function. The CRFObjectiveFunctionGradient object will already be configured witht eh appropriate training data, so it appears here as a pure function evaluation.

Specified by:
optimize in interface CRFTraining
Parameters:
fm - the model to train on.
data - the training data to use for training.
Returns:
an array of doubles containing the optimal weights.

setStarts

public void setStarts(double[] weights)
starting weights are ignored for a SeededOptimizer, since they are always taken from the seeded model.

Specified by:
setStarts in interface CRFTraining
Parameters:
weights - an array of weights to use as the starting point for the optimizer. The optimzier is not required to use this as a starting point.

getSeededOptimizer

public CRFTraining getSeededOptimizer()
Returns:
the seededOptimizer

setSeededOptimizer

public void setSeededOptimizer(CRFTraining seededOptimizer)
Parameters:
seededOptimizer - the seededOptimizer to set

getSeedModel

public java.io.File getSeedModel()
Returns:
the seedModel

setSeedModel

public void setSeedModel(java.io.File seedModel)
Parameters:
seedModel - the seedModel to set