Class MaxEntFLPRConstraints

    • Field Detail

      • useValues

        protected boolean useValues
      • numFeatures

        protected int numFeatures
      • numLabels

        protected int numLabels
      • indexCache

        protected com.carrotsearch.hppc.IntArrayList indexCache
      • valueCache

        protected com.carrotsearch.hppc.DoubleArrayList valueCache
    • Constructor Detail

      • MaxEntFLPRConstraints

        public MaxEntFLPRConstraints​(int numFeatures,
                                     int numLabels,
                                     boolean useValues)
    • Method Detail

      • addConstraint

        public abstract void addConstraint​(int fi,
                                           double[] ex,
                                           double weight)
      • preProcess

        public java.util.BitSet preProcess​(InstanceList data)
        Specified by:
        preProcess in interface MaxEntPRConstraint
        data - Unlabeled data
        Returns a bitset of the size of the data, with the bit set if a constraint feature fires in that instance.
      • preProcess

        public void preProcess​(FeatureVector input)
        Description copied from interface: MaxEntPRConstraint
        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 MaxEntPRConstraint
        input - FeatureVector input