cc.mallet.fst
Class CRFOptimizableByLabelLikelihood
java.lang.Object
cc.mallet.fst.CRFOptimizableByLabelLikelihood
- All Implemented Interfaces:
- Optimizable, Optimizable.ByGradientValue, java.io.Serializable
- Direct Known Subclasses:
- MEMMTrainer.MEMMOptimizableByLabelLikelihood
public class CRFOptimizableByLabelLikelihood
- extends java.lang.Object
- implements Optimizable.ByGradientValue, java.io.Serializable
An objective function for CRFs that is the label likelihood plus a Gaussian or hyperbolic prior on parameters.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
trainingSet
protected InstanceList trainingSet
cachedValue
protected double cachedValue
cachedGradient
protected double[] cachedGradient
infiniteValues
protected java.util.BitSet infiniteValues
crf
protected CRF crf
constraints
protected CRF.Factors constraints
expectations
protected CRF.Factors expectations
CRFOptimizableByLabelLikelihood
public CRFOptimizableByLabelLikelihood(CRF crf,
InstanceList ilist)
gatherConstraints
protected void gatherConstraints(InstanceList ilist)
getNumParameters
public int getNumParameters()
- Specified by:
getNumParameters
in interface Optimizable
getParameters
public void getParameters(double[] buffer)
- Specified by:
getParameters
in interface Optimizable
getParameter
public double getParameter(int index)
- Specified by:
getParameter
in interface Optimizable
setParameters
public void setParameters(double[] buff)
- Specified by:
setParameters
in interface Optimizable
setParameter
public void setParameter(int index,
double value)
- Specified by:
setParameter
in interface Optimizable
getExpectationValue
protected double getExpectationValue()
getValue
public double getValue()
- Returns the log probability of the training sequence labels and the prior over parameters.
- Specified by:
getValue
in interface Optimizable.ByGradientValue
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradient
in interface Optimizable.ByGradientValue
setUseHyperbolicPrior
public void setUseHyperbolicPrior(boolean f)
setHyperbolicPriorSlope
public void setHyperbolicPriorSlope(double p)
setHyperbolicPriorSharpness
public void setHyperbolicPriorSharpness(double p)
getUseHyperbolicPriorSlope
public double getUseHyperbolicPriorSlope()
getUseHyperbolicPriorSharpness
public double getUseHyperbolicPriorSharpness()
setGaussianPriorVariance
public void setGaussianPriorVariance(double p)
getGaussianPriorVariance
public double getGaussianPriorVariance()