cc.mallet.classify.constraints.pr
Class MaxEntL2FLPRConstraints
java.lang.Object
cc.mallet.classify.constraints.pr.MaxEntFLPRConstraints
cc.mallet.classify.constraints.pr.MaxEntL2FLPRConstraints
- All Implemented Interfaces:
- MaxEntPRConstraint
public class MaxEntL2FLPRConstraints
- extends MaxEntFLPRConstraints
Expectation constraint for use with Posterior Regularization (PR).
Penalizes L_2^2 difference from target distribution.
- Author:
- Gregory Druck
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MaxEntL2FLPRConstraints
public MaxEntL2FLPRConstraints(int numFeatures,
int numLabels,
boolean useValues,
boolean normalize)
addConstraint
public void addConstraint(int fi,
double[] ex,
double weight)
- Specified by:
addConstraint
in class MaxEntFLPRConstraints
numDimensions
public int numDimensions()
getAuxiliaryValueContribution
public double getAuxiliaryValueContribution(double[] parameters)
getGradient
public void getGradient(double[] parameters,
double[] gradient)
getCompleteValueContribution
public double getCompleteValueContribution()
getScore
public double getScore(FeatureVector input,
int label,
double[] parameters)