cc.mallet.classify.constraints.ge
Class MaxEntKLFLGEConstraints

java.lang.Object
  extended by cc.mallet.classify.constraints.ge.MaxEntFLGEConstraints
      extended by cc.mallet.classify.constraints.ge.MaxEntKLFLGEConstraints
All Implemented Interfaces:
MaxEntGEConstraint

public class MaxEntKLFLGEConstraints
extends MaxEntFLGEConstraints

Expectation constraint for use with GE. Penalizes KL divergence from target distribution. Multiple constraints are grouped together here to make things more efficient.

Author:
Gregory Druck

Nested Class Summary
protected  class MaxEntKLFLGEConstraints.MaxEntKLFLGEConstraint
           
 
Nested classes/interfaces inherited from class cc.mallet.classify.constraints.ge.MaxEntFLGEConstraints
MaxEntFLGEConstraints.MaxEntFLGEConstraint
 
Field Summary
 
Fields inherited from class cc.mallet.classify.constraints.ge.MaxEntFLGEConstraints
constraints, indexCache, numFeatures, numLabels, useValues, valueCache
 
Constructor Summary
MaxEntKLFLGEConstraints(int numFeatures, int numLabels, boolean useValues)
           
 
Method Summary
 void addConstraint(int fi, double[] ex, double weight)
           
 double getValue()
          Returns the total constraint value.
 
Methods inherited from class cc.mallet.classify.constraints.ge.MaxEntFLGEConstraints
computeExpectations, getCompositeConstraintFeatureValue, preProcess, preProcess, zeroExpectations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MaxEntKLFLGEConstraints

public MaxEntKLFLGEConstraints(int numFeatures,
                               int numLabels,
                               boolean useValues)
Method Detail

getValue

public double getValue()
Description copied from interface: MaxEntGEConstraint
Returns the total constraint value.

Returns:
Constraint value

addConstraint

public void addConstraint(int fi,
                          double[] ex,
                          double weight)
Specified by:
addConstraint in class MaxEntFLGEConstraints