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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
MaxEntL2FLPRConstraints.MaxEntL2FLPRConstraint
-
Nested classes/interfaces inherited from class cc.mallet.classify.constraints.pr.MaxEntFLPRConstraints
MaxEntFLPRConstraints.MaxEntFLPRConstraint
-
-
Field Summary
-
Fields inherited from class cc.mallet.classify.constraints.pr.MaxEntFLPRConstraints
constraints, indexCache, numFeatures, numLabels, useValues, valueCache
-
-
Constructor Summary
Constructors Constructor Description MaxEntL2FLPRConstraints(int numFeatures, int numLabels, boolean useValues, boolean normalize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConstraint(int fi, double[] ex, double weight)
double
getAuxiliaryValueContribution(double[] parameters)
double
getCompleteValueContribution()
void
getGradient(double[] parameters, double[] gradient)
double
getScore(FeatureVector input, int label, double[] parameters)
int
numDimensions()
-
Methods inherited from class cc.mallet.classify.constraints.pr.MaxEntFLPRConstraints
incrementExpectations, preProcess, preProcess, zeroExpectations
-
-
-
-
Method Detail
-
addConstraint
public void addConstraint(int fi, double[] ex, double weight)
- Specified by:
addConstraint
in classMaxEntFLPRConstraints
-
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)
-
-