cc.mallet.classify.constraints.pr
Interface MaxEntPRConstraint

All Known Implementing Classes:
MaxEntFLPRConstraints, MaxEntL2FLPRConstraints

public interface MaxEntPRConstraint

Interface for expectation constraints for use with Posterior Regularization (PR).

Author:
Gregory Druck

Method Summary
 double getAuxiliaryValueContribution(double[] parameters)
           
 double getCompleteValueContribution()
           
 void getGradient(double[] parameters, double[] gradient)
           
 double getScore(FeatureVector input, int label, double[] parameters)
           
 void incrementExpectations(FeatureVector fv, double[] dist, double weight)
           
 int numDimensions()
           
 void preProcess(FeatureVector input)
          Gives the constraint the option to do some caching using only the FeatureVector.
 java.util.BitSet preProcess(InstanceList data)
           
 void zeroExpectations()
          Zero expectation values.
 

Method Detail

numDimensions

int numDimensions()

getScore

double getScore(FeatureVector input,
                int label,
                double[] parameters)

incrementExpectations

void incrementExpectations(FeatureVector fv,
                           double[] dist,
                           double weight)

getAuxiliaryValueContribution

double getAuxiliaryValueContribution(double[] parameters)

getCompleteValueContribution

double getCompleteValueContribution()

getGradient

void getGradient(double[] parameters,
                 double[] gradient)

zeroExpectations

void zeroExpectations()
Zero expectation values. Called before re-computing gradient.


preProcess

java.util.BitSet preProcess(InstanceList data)
Parameters:
data - Unlabeled data
Returns:
Returns a bitset of the size of the data, with the bit set if a constraint feature fires in that instance.

preProcess

void preProcess(FeatureVector input)
Gives the constraint the option to do some caching using only the FeatureVector. For example, the constrained input features could be cached.

Parameters:
input - FeatureVector input