|
||||||||||
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.OneLabelL2RangeGEConstraints
public class OneLabelL2RangeGEConstraints
A set of constraints on individual input feature label pairs. This is to be used with GE, and penalizes the L_2^2 difference between model and target distributions. Multiple constraints are grouped together here to make things more efficient.
Nested Class Summary | |
---|---|
protected class |
OneLabelL2RangeGEConstraints.OneLabelL2IndGEConstraint
|
Field Summary | |
---|---|
protected gnu.trove.TIntArrayList |
cache
|
protected gnu.trove.TIntObjectHashMap<OneLabelL2RangeGEConstraints.OneLabelL2IndGEConstraint> |
constraints
|
protected StateLabelMap |
map
|
Constructor Summary | |
---|---|
|
OneLabelL2RangeGEConstraints()
|
protected |
OneLabelL2RangeGEConstraints(gnu.trove.TIntObjectHashMap<OneLabelL2RangeGEConstraints.OneLabelL2IndGEConstraint> constraints,
StateLabelMap map)
|
Method Summary | |
---|---|
void |
addConstraint(int fi,
int li,
double lower,
double upper,
double weight)
|
void |
computeExpectations(java.util.ArrayList<SumLattice> lattices)
Compute expectations using cached lattices. |
GEConstraint |
copy()
This is used in multi-threading. |
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. |
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 |
Field Detail |
---|
protected gnu.trove.TIntObjectHashMap<OneLabelL2RangeGEConstraints.OneLabelL2IndGEConstraint> constraints
protected StateLabelMap map
protected gnu.trove.TIntArrayList cache
Constructor Detail |
---|
public OneLabelL2RangeGEConstraints()
protected OneLabelL2RangeGEConstraints(gnu.trove.TIntObjectHashMap<OneLabelL2RangeGEConstraints.OneLabelL2IndGEConstraint> constraints, StateLabelMap map)
Method Detail |
---|
public void addConstraint(int fi, int li, double lower, double upper, double weight)
public 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 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 SumLatticespublic GEConstraint copy()
GEConstraint
copy
in interface GEConstraint
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |