cc.mallet.fst.semi_supervised
Class CRFOptimizableByEntropyRegularization

java.lang.Object
  extended by 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
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
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
 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)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 interface Optimizable.ByGradientValue

getValueGradient

public void getValueGradient(double[] buffer)
Specified by:
getValueGradient in interface Optimizable.ByGradientValue

getNumParameters

public int getNumParameters()
Specified by:
getNumParameters in interface Optimizable

getParameters

public void getParameters(double[] buffer)
Specified by:
getParameters in interface Optimizable

setParameters

public void setParameters(double[] buffer)
Specified by:
setParameters in interface Optimizable

getParameter

public double getParameter(int index)
Specified by:
getParameter in interface Optimizable

setParameter

public void setParameter(int index,
                         double value)
Specified by:
setParameter in interface Optimizable