|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcalhoun.analysis.crf.solver.SimplexOptimizer
public class SimplexOptimizer
uses a nelder-mead algorithm (the simplex method) to do a general function optimization objective function.
This optimization method does not use the gradient but requires many iterations and so is mainly useful in
debugging. Use the StandardOptimizer for most problems.
This optimizer has several configuration properties that allow control over the optimization process:
maxIters - The maximum number of iterations (objective function evaluations) to attempt
requireConverge - if true, throws an error if convergence is not reached in the maximum number
of iterations. Otherwise, the current feature weights are returned when maxIters is reached.
stepSize - the size of the initial changes made to the weights when exploring the objective function.
starts - an initial set of guesses at feature weights. Defaults to 1.0
| Constructor Summary | |
|---|---|
SimplexOptimizer()
|
|
| Method Summary | |
|---|---|
int |
getMaxIters()
|
CRFObjectiveFunctionGradient |
getObjectiveFunction()
returns the configured objective function gradient which will be used by the optimizer during the training process. |
double[] |
getStarts()
|
double |
getStepSize()
|
boolean |
isRequireConvergence()
|
double[] |
optimize(ModelManager fm,
java.util.List<? extends TrainingSequence<?>> data)
find the set of weights which maximizes the value of the objective function. |
void |
setMaxIters(int maxIters)
|
void |
setObjectiveFunction(CRFObjectiveFunctionGradient objectiveFunction)
sets the objective function gradient. |
void |
setRequireConvergence(boolean requireConvergence)
|
void |
setStarts(double[] starts)
Sets the starting weights for the optimization. |
void |
setStepSize(double stepSize)
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SimplexOptimizer()
| Method Detail |
|---|
public double[] optimize(ModelManager fm,
java.util.List<? extends TrainingSequence<?>> data)
CRFTrainingCRFObjectiveFunctionGradient object will already
be configured witht eh appropriate training data, so it appears here as a pure function evaluation.
optimize in interface CRFTrainingfm - the model to train on.data - the training data to use for training.
public CRFObjectiveFunctionGradient getObjectiveFunction()
public void setObjectiveFunction(CRFObjectiveFunctionGradient objectiveFunction)
public int getMaxIters()
public void setMaxIters(int maxIters)
public boolean isRequireConvergence()
public void setRequireConvergence(boolean requireConvergence)
public double[] getStarts()
public void setStarts(double[] starts)
CRFTraining
setStarts in interface CRFTrainingstarts - 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.public double getStepSize()
public void setStepSize(double stepSize)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||