secondPass - A reference to a configured CRFTraining object that will be used to optimize the
weights in the second pass of the optimization. The second pass will begin using the weights computed during the first
pass.
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TwoPassOptimizer
public TwoPassOptimizer()
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)
- Description copied from interface:
CRFTraining
- Sets the starting weights for the optimization.
- 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.
getFirstPass
public CRFTraining getFirstPass()
- Returns:
- the firstPass
setFirstPass
public void setFirstPass(CRFTraining firstPass)
- Parameters:
firstPass - the firstPass to set
getSecondPass
public CRFTraining getSecondPass()
- Returns:
- the secondPass
setSecondPass
public void setSecondPass(CRFTraining secondPass)
- Parameters:
secondPass - the secondPass to set