Interface MaxEntGEConstraint

    • Method Detail

      • getCompositeConstraintFeatureValue

        double getCompositeConstraintFeatureValue​(FeatureVector input,
                                                  int label)
        Computes the composite constraint feature value (over all constraint features) for FeatureVector fv and label label.
        Parameters:
        input - input FeatureVector
        label - output label index
        Returns:
        Constraint feature value
      • getValue

        double getValue()
        Returns the total constraint value.
        Returns:
        Constraint value
      • computeExpectations

        void computeExpectations​(FeatureVector fv,
                                 double[] dist,
                                 double weight)
        Compute expectations using provided distribution over labels.
        Parameters:
        fv - FeatureVector
        dist - Distribution over labels
        data - Unlabeled data
      • zeroExpectations

        void zeroExpectations()
        Zero expectation values. Called before re-computing gradient.
      • preProcess

        java.util.BitSet preProcess​(InstanceList data)
        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.
      • preProcess

        void preProcess​(FeatureVector input)
        Gives the constraint the option to do some caching using only the FeatureVector. For example, the constrained input features could be cached.
        Parameters:
        input - FeatureVector input