calhoun.analysis.crf.solver
Class SeededOptimizer
java.lang.Object
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.
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SeededOptimizer
public SeededOptimizer()
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