|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.fst.semi_supervised.constraints.TwoLabelGEConstraints
public abstract class TwoLabelGEConstraints
A set of constraints on distributions over pairs of consecutive labels conditioned on the presence of input features. Subclasses are to be used with GE. Multiple constraints are grouped together here to make things more efficient.
Nested Class Summary | |
---|---|
protected class |
TwoLabelGEConstraints.TwoLabelGEConstraint
|
Field Summary | |
---|---|
protected gnu.trove.TIntArrayList |
cache
|
protected java.util.ArrayList<TwoLabelGEConstraints.TwoLabelGEConstraint> |
constraintsList
|
protected gnu.trove.TIntIntHashMap |
constraintsMap
|
protected StateLabelMap |
map
|
Constructor Summary | |
---|---|
|
TwoLabelGEConstraints()
|
protected |
TwoLabelGEConstraints(java.util.ArrayList<TwoLabelGEConstraints.TwoLabelGEConstraint> constraintsList,
gnu.trove.TIntIntHashMap constraintsMap,
StateLabelMap map)
|
Method Summary | |
---|---|
abstract void |
addConstraint(int fi,
double[][] target,
double weight)
|
void |
computeExpectations(java.util.ArrayList<SumLattice> lattices)
Compute expectations using cached lattices. |
double |
getCompositeConstraintFeatureValue(FeatureVector fv,
int ip,
int si1,
int si2)
Computes the composite constraint feature value (over all constraint features) for FeatureVector fv and a transition from state li1 to li2. |
abstract double |
getValue()
Returns the total constraint value. |
boolean |
isOneStateConstraint()
|
void |
preProcess(FeatureVector fv)
Gives the constraint the option to do some caching using only the FeatureVector. |
java.util.BitSet |
preProcess(InstanceList data)
|
void |
setStateLabelMap(StateLabelMap map)
Sets that map between the state indices and label indices. |
void |
zeroExpectations()
Zero expectation values. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cc.mallet.fst.semi_supervised.constraints.GEConstraint |
---|
copy |
Field Detail |
---|
protected java.util.ArrayList<TwoLabelGEConstraints.TwoLabelGEConstraint> constraintsList
protected gnu.trove.TIntIntHashMap constraintsMap
protected StateLabelMap map
protected gnu.trove.TIntArrayList cache
Constructor Detail |
---|
public TwoLabelGEConstraints()
protected TwoLabelGEConstraints(java.util.ArrayList<TwoLabelGEConstraints.TwoLabelGEConstraint> constraintsList, gnu.trove.TIntIntHashMap constraintsMap, StateLabelMap map)
Method Detail |
---|
public abstract void addConstraint(int fi, double[][] target, double weight)
fi
- Input feature indextarget
- Target distribution over pairs of labelsweight
- Weight of this constraintpublic boolean isOneStateConstraint()
isOneStateConstraint
in interface GEConstraint
public void setStateLabelMap(StateLabelMap map)
GEConstraint
setStateLabelMap
in interface GEConstraint
map
- StateLabelMappublic void preProcess(FeatureVector fv)
GEConstraint
preProcess
in interface GEConstraint
fv
- FeatureVector inputpublic java.util.BitSet preProcess(InstanceList data)
preProcess
in interface GEConstraint
data
- Unlabeled data
public double getCompositeConstraintFeatureValue(FeatureVector fv, int ip, int si1, int si2)
GEConstraint
getCompositeConstraintFeatureValue
in interface GEConstraint
fv
- FeatureVector on transitionip
- Position of input in sequencesi1
- Source state index for transitionsi2
- Destination state index for transition
public abstract double getValue()
GEConstraint
getValue
in interface GEConstraint
public void zeroExpectations()
GEConstraint
zeroExpectations
in interface GEConstraint
public void computeExpectations(java.util.ArrayList<SumLattice> lattices)
GEConstraint
computeExpectations
in interface GEConstraint
lattices
- Cached SumLattices
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |