Interface GEConstraint

    • Method Detail

      • getCompositeConstraintFeatureValue

        double getCompositeConstraintFeatureValue​(FeatureVector input,
                                                  int inputPosition,
                                                  int srcIndex,
                                                  int destIndex)
        Computes the composite constraint feature value (over all constraint features) for FeatureVector fv and a transition from state li1 to li2.
        Parameters:
        input - FeatureVector on transition
        inputPosition - Position of input in sequence
        srcIndex - Source state index for transition
        destIndex - Destination state index for transition
        Returns:
        Constraint feature value
      • getValue

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

        void computeExpectations​(java.util.ArrayList<SumLattice> lattices)
        Compute expectations using cached lattices.
        Parameters:
        lattices - Cached SumLattices
        data - Unlabeled data
      • zeroExpectations

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

        void setStateLabelMap​(StateLabelMap map)
        Sets that map between the state indices and label indices.
        Parameters:
        map - StateLabelMap
      • copy

        GEConstraint copy()
        This is used in multi-threading.
        Returns:
        A copy of the GEConstraint.
      • isOneStateConstraint

        boolean isOneStateConstraint()
        Returns:
        true if constraint feature only considers one state
      • 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