cc.mallet.classify.constraints.pr
Class MaxEntFLPRConstraints
- java.lang.Object
-
- cc.mallet.classify.constraints.pr.MaxEntFLPRConstraints
-
- All Implemented Interfaces:
- MaxEntPRConstraint
- Direct Known Subclasses:
- MaxEntL2FLPRConstraints
public abstract class MaxEntFLPRConstraints extends java.lang.Object implements MaxEntPRConstraint
Abstract expectation constraint for use with Posterior Regularization (PR).
-
-
Constructor Summary
Constructors Constructor and Description MaxEntFLPRConstraints(int numFeatures, int numLabels, boolean useValues)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description abstract voidaddConstraint(int fi, double[] ex, double weight)voidincrementExpectations(FeatureVector input, double[] dist, double weight)voidpreProcess(FeatureVector input)Gives the constraint the option to do some caching using only the FeatureVector.java.util.BitSetpreProcess(InstanceList data)voidzeroExpectations()Zero expectation values.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface cc.mallet.classify.constraints.pr.MaxEntPRConstraint
getAuxiliaryValueContribution, getCompleteValueContribution, getGradient, getScore, numDimensions
-
-
-
-
Constructor Detail
-
MaxEntFLPRConstraints
public MaxEntFLPRConstraints(int numFeatures, int numLabels, boolean useValues)
-
-
Method Detail
-
addConstraint
public abstract void addConstraint(int fi, double[] ex, double weight)
-
incrementExpectations
public void incrementExpectations(FeatureVector input, double[] dist, double weight)
- Specified by:
incrementExpectationsin interfaceMaxEntPRConstraint
-
zeroExpectations
public void zeroExpectations()
Description copied from interface:MaxEntPRConstraintZero expectation values. Called before re-computing gradient.- Specified by:
zeroExpectationsin interfaceMaxEntPRConstraint
-
preProcess
public java.util.BitSet preProcess(InstanceList data)
- Specified by:
preProcessin interfaceMaxEntPRConstraint- 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
public void preProcess(FeatureVector input)
Description copied from interface:MaxEntPRConstraintGives the constraint the option to do some caching using only the FeatureVector. For example, the constrained input features could be cached.- Specified by:
preProcessin interfaceMaxEntPRConstraint- Parameters:
input- FeatureVector input
-
-
DataMelt 3.0 © DataMelt by jWork.ORG