Documentation of 'cc.mallet.fst.semi_supervised.pr.constraints.OneLabelL2IndPRConstraints' Java class
OneLabelL2IndPRConstraints
cc.mallet.fst.semi_supervised.pr.constraints

Class OneLabelL2IndPRConstraints

  • All Implemented Interfaces:
    PRConstraint


    public class OneLabelL2IndPRConstraints
    extends java.lang.Object
    implements PRConstraint
    A set of constraints on individual input feature label pairs. This is to be used with PR, and penalizes L_2^2 difference from target expectations. Multiple constraints are grouped together here to make things more efficient.
    • Constructor Detail

      • OneLabelL2IndPRConstraints

        public OneLabelL2IndPRConstraints(boolean normalized)
    • Method Detail

      • copy

        public PRConstraint copy()
        Description copied from interface: PRConstraint
        This is used in multi-threading.
        Specified by:
        copy in interface PRConstraint
        Returns:
        A copy of the GEConstraint.
      • addConstraint

        public void addConstraint(int fi,
                                  int li,
                                  double target,
                                  double weight)
      • setStateLabelMap

        public void setStateLabelMap(StateLabelMap map)
        Description copied from interface: PRConstraint
        Sets that map between the state indices and label indices.
        Specified by:
        setStateLabelMap in interface PRConstraint
        Parameters:
        map - StateLabelMap
      • preProcess

        public void preProcess(FeatureVector fv)
        Description copied from interface: PRConstraint
        Gives the constraint the option to do some caching using only the FeatureVector. For example, the constrained input features could be cached.
        Specified by:
        preProcess in interface PRConstraint
        Parameters:
        fv - FeatureVector input
      • preProcess

        public java.util.BitSet preProcess(InstanceList data)
        Specified by:
        preProcess in interface PRConstraint
        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.
      • getScore

        public double getScore(FeatureVector input,
                               int inputPosition,
                               int srcIndex,
                               int destIndex,
                               double[] parameters)
        Specified by:
        getScore in interface PRConstraint
      • zeroExpectations

        public void zeroExpectations()
        Description copied from interface: PRConstraint
        Zero expectation values. Called before re-computing gradient.
        Specified by:
        zeroExpectations in interface PRConstraint
      • getGradient

        public void getGradient(double[] parameters,
                                double[] gradient)
        Specified by:
        getGradient in interface PRConstraint

DataMelt 3.0 © DataMelt by jWork.ORG

Ads help maintain this website.