Package cc.mallet.fst.semi_supervised
Class CRFOptimizableByEntropyRegularization
- java.lang.Object
-
- cc.mallet.fst.semi_supervised.CRFOptimizableByEntropyRegularization
-
- All Implemented Interfaces:
Optimizable
,Optimizable.ByGradientValue
,java.io.Serializable
public class CRFOptimizableByEntropyRegularization extends java.lang.Object implements Optimizable.ByGradientValue, java.io.Serializable
A CRF objective function that is the entropy of the CRF's predictions on unlabeled data. References: Feng Jiao, Shaojun Wang, Chi-Hoon Lee, Russell Greiner, Dale Schuurmans "Semi-supervised conditional random fields for improved sequence segmentation and labeling" ACL 2006 Gideon Mann, Andrew McCallum "Efficient Computation of Entropy Gradient for Semi-Supervised Conditional Random Fields" HLT/NAACL 2007- Author:
- Gaurav Chandalia, Gregory Druck
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface cc.mallet.optimize.Optimizable
Optimizable.ByBatchGradient, Optimizable.ByCombiningBatchGradient, Optimizable.ByGISUpdate, Optimizable.ByGradient, Optimizable.ByGradientValue, Optimizable.ByHessian, Optimizable.ByValue, Optimizable.ByVotedPerceptron
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]
cachedGradient
protected double
cachedValue
protected CRF
crf
protected InstanceList
data
protected CRF.Factors
expectations
protected Transducer.Incrementor
incrementor
protected double
scalingFactor
-
Constructor Summary
Constructors Constructor Description CRFOptimizableByEntropyRegularization(CRF crf, InstanceList ilist)
Initializes the structures (sets the scaling factor to 1.0).CRFOptimizableByEntropyRegularization(CRF crf, InstanceList ilist, double scalingFactor)
Initializes the structures.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeExpectations()
Resets, computes and fills expectations from all instances, also updating the entropy value.int
getNumParameters()
double
getParameter(int index)
void
getParameters(double[] buffer)
double
getScalingFactor()
double
getValue()
void
getValueGradient(double[] buffer)
void
setParameter(int index, double value)
void
setParameters(double[] buffer)
void
setScalingFactor(double scalingFactor)
-
-
-
Field Detail
-
expectations
protected CRF.Factors expectations
-
incrementor
protected Transducer.Incrementor incrementor
-
data
protected InstanceList data
-
crf
protected CRF crf
-
scalingFactor
protected double scalingFactor
-
cachedValue
protected double cachedValue
-
cachedGradient
protected double[] cachedGradient
-
-
Constructor Detail
-
CRFOptimizableByEntropyRegularization
public CRFOptimizableByEntropyRegularization(CRF crf, InstanceList ilist, double scalingFactor)
Initializes the structures.
-
CRFOptimizableByEntropyRegularization
public CRFOptimizableByEntropyRegularization(CRF crf, InstanceList ilist)
Initializes the structures (sets the scaling factor to 1.0).
-
-
Method Detail
-
getScalingFactor
public double getScalingFactor()
-
setScalingFactor
public void setScalingFactor(double scalingFactor)
-
computeExpectations
public void computeExpectations()
Resets, computes and fills expectations from all instances, also updating the entropy value.Analogous to CRFOptimizableByLabelLikelihood.getExpectationValue.
-
getValue
public double getValue()
- Specified by:
getValue
in interfaceOptimizable.ByGradientValue
-
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradient
in interfaceOptimizable.ByGradientValue
-
getNumParameters
public int getNumParameters()
- Specified by:
getNumParameters
in interfaceOptimizable
-
getParameters
public void getParameters(double[] buffer)
- Specified by:
getParameters
in interfaceOptimizable
-
setParameters
public void setParameters(double[] buffer)
- Specified by:
setParameters
in interfaceOptimizable
-
getParameter
public double getParameter(int index)
- Specified by:
getParameter
in interfaceOptimizable
-
setParameter
public void setParameter(int index, double value)
- Specified by:
setParameter
in interfaceOptimizable
-
-