calhoun.analysis.crf
Interface CRFTraining

All Known Implementing Classes:
FixedWeightOptimizer, SeededOptimizer, SimplexOptimizer, StandardOptimizer, TwoPassOptimizer

public interface CRFTraining

an interface to numerical solvers for optimizing the CRF objective function. Conrad will call this when training the weights, and this class is reponsible for evlauating the objective function iteratively and determining the weights. Usually, this class will just be a wrapper around some standard numerical solving package.

The optimizer is not required to find an optimal set of weights. Although this is usually the goal and is usually feasible, the interface only requires that a feature weight be assigned for each feature. It is legal for the optimizer to return suboptimal weights.


Method Summary
 double[] optimize(ModelManager fm, java.util.List<? extends TrainingSequence<?>> data)
          find the set of weights which maximizes the value of the objective function.
 void setStarts(double[] weights)
          Sets the starting weights for the optimization.
 

Method Detail

optimize

double[] optimize(ModelManager fm,
                  java.util.List<? extends TrainingSequence<?>> data)
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.

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

void setStarts(double[] weights)
Sets the starting weights for the optimization.

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.