cc.mallet.fst.semi_supervised.constraints
Class TwoLabelL2GEConstraints

java.lang.Object
  extended by cc.mallet.fst.semi_supervised.constraints.TwoLabelGEConstraints
      extended by cc.mallet.fst.semi_supervised.constraints.TwoLabelL2GEConstraints
All Implemented Interfaces:
GEConstraint

public class TwoLabelL2GEConstraints
extends TwoLabelGEConstraints

A set of constraints on distributions over consecutive labels conditioned an input features. 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.

Author:
Gregory Druck

Nested Class Summary
protected  class TwoLabelL2GEConstraints.TwoLabelL2GEConstraint
           
 
Nested classes/interfaces inherited from class cc.mallet.fst.semi_supervised.constraints.TwoLabelGEConstraints
TwoLabelGEConstraints.TwoLabelGEConstraint
 
Field Summary
 
Fields inherited from class cc.mallet.fst.semi_supervised.constraints.TwoLabelGEConstraints
cache, constraintsList, constraintsMap, map
 
Constructor Summary
TwoLabelL2GEConstraints()
           
 
Method Summary
 void addConstraint(int fi, double[][] target, double weight)
           
 GEConstraint copy()
          This is used in multi-threading.
 double getValue()
          Returns the total constraint value.
 
Methods inherited from class cc.mallet.fst.semi_supervised.constraints.TwoLabelGEConstraints
computeExpectations, getCompositeConstraintFeatureValue, isOneStateConstraint, preProcess, preProcess, setStateLabelMap, zeroExpectations
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TwoLabelL2GEConstraints

public TwoLabelL2GEConstraints()
Method Detail

copy

public GEConstraint copy()
Description copied from interface: GEConstraint
This is used in multi-threading.

Returns:
A copy of the GEConstraint.

addConstraint

public void addConstraint(int fi,
                          double[][] target,
                          double weight)
Specified by:
addConstraint in class TwoLabelGEConstraints
Parameters:
fi - Input feature index
target - Target distribution over pairs of labels
weight - Weight of this constraint

getValue

public double getValue()
Description copied from interface: GEConstraint
Returns the total constraint value.

Specified by:
getValue in interface GEConstraint
Specified by:
getValue in class TwoLabelGEConstraints
Returns:
Constraint value