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[]cachedGradientprotected doublecachedValueprotected CRFcrfprotected InstanceListdataprotected CRF.Factorsexpectationsprotected Transducer.Incrementorincrementorprotected doublescalingFactor
-
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 voidcomputeExpectations()Resets, computes and fills expectations from all instances, also updating the entropy value.intgetNumParameters()doublegetParameter(int index)voidgetParameters(double[] buffer)doublegetScalingFactor()doublegetValue()voidgetValueGradient(double[] buffer)voidsetParameter(int index, double value)voidsetParameters(double[] buffer)voidsetScalingFactor(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:
getValuein interfaceOptimizable.ByGradientValue
-
getValueGradient
public void getValueGradient(double[] buffer)
- Specified by:
getValueGradientin interfaceOptimizable.ByGradientValue
-
getNumParameters
public int getNumParameters()
- Specified by:
getNumParametersin interfaceOptimizable
-
getParameters
public void getParameters(double[] buffer)
- Specified by:
getParametersin interfaceOptimizable
-
setParameters
public void setParameters(double[] buffer)
- Specified by:
setParametersin interfaceOptimizable
-
getParameter
public double getParameter(int index)
- Specified by:
getParameterin interfaceOptimizable
-
setParameter
public void setParameter(int index, double value)- Specified by:
setParameterin interfaceOptimizable
-
-