|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.classify.constraints.ge.MaxEntRangeL2FLGEConstraints
public class MaxEntRangeL2FLGEConstraints
Expectation constraint for use with GE. Penalizes L_2^2 difference from zero-penalty region [lower,upper]. Multiple constraints are grouped together here to make things more efficient.
Nested Class Summary | |
---|---|
protected class |
MaxEntRangeL2FLGEConstraints.MaxEntL2IndGEConstraint
|
Field Summary | |
---|---|
protected gnu.trove.TIntObjectHashMap<MaxEntRangeL2FLGEConstraints.MaxEntL2IndGEConstraint> |
constraints
|
protected gnu.trove.TIntArrayList |
indexCache
|
protected gnu.trove.TDoubleArrayList |
valueCache
|
Constructor Summary | |
---|---|
MaxEntRangeL2FLGEConstraints(int numFeatures,
int numLabels,
boolean useValues,
boolean normalize)
|
Method Summary | |
---|---|
void |
addConstraint(int fi,
int li,
double lower,
double upper,
double weight)
|
void |
computeExpectations(FeatureVector input,
double[] dist,
double weight)
Compute expectations using provided distribution over labels. |
double |
getCompositeConstraintFeatureValue(FeatureVector input,
int label)
Computes the composite constraint feature value (over all constraint features) for FeatureVector fv and label label. |
double |
getValue()
Returns the total constraint value. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected gnu.trove.TIntObjectHashMap<MaxEntRangeL2FLGEConstraints.MaxEntL2IndGEConstraint> constraints
protected gnu.trove.TIntArrayList indexCache
protected gnu.trove.TDoubleArrayList valueCache
Constructor Detail |
---|
public MaxEntRangeL2FLGEConstraints(int numFeatures, int numLabels, boolean useValues, boolean normalize)
Method Detail |
---|
public void addConstraint(int fi, int li, double lower, double upper, double weight)
public java.util.BitSet preProcess(InstanceList data)
preProcess
in interface MaxEntGEConstraint
data
- Unlabeled data
public void preProcess(FeatureVector input)
MaxEntGEConstraint
preProcess
in interface MaxEntGEConstraint
input
- FeatureVector inputpublic double getCompositeConstraintFeatureValue(FeatureVector input, int label)
MaxEntGEConstraint
getCompositeConstraintFeatureValue
in interface MaxEntGEConstraint
input
- input FeatureVectorlabel
- output label index
public void computeExpectations(FeatureVector input, double[] dist, double weight)
MaxEntGEConstraint
computeExpectations
in interface MaxEntGEConstraint
input
- FeatureVectordist
- Distribution over labelspublic double getValue()
MaxEntGEConstraint
getValue
in interface MaxEntGEConstraint
public void zeroExpectations()
MaxEntGEConstraint
zeroExpectations
in interface MaxEntGEConstraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |