edu.stanford.nlp.maxent.iis
Class ByteFeature

java.lang.Object
  |
  +--edu.stanford.nlp.maxent.iis.Feature
        |
        +--edu.stanford.nlp.maxent.iis.ByteFeature

public class ByteFeature
extends Feature

This class is used when we are sure the feature will have a value in 0-255 for each data pair


Field Summary
protected  HashMap hashValues
           
 byte[] valuesI
          These are the non-zero values we want to keep for the points is indexedValues.
 
Fields inherited from class edu.stanford.nlp.maxent.iis.Feature
indexedValues, sum
 
Constructor Summary
ByteFeature()
           
ByteFeature(Experiments e, byte[][] vals)
           
ByteFeature(Experiments e, int[] indexes, byte[] vals)
           
 
Method Summary
 double ftiled()
           
 double getVal(int index)
          Get the value at the index-ed non zero value pair (x,y)
 boolean isEmpty()
           
 
Methods inherited from class edu.stanford.nlp.maxent.iis.Feature
getVal, getX, getY, initHashVals, len, print, print, read, save, setSum, sumValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valuesI

public byte[] valuesI
These are the non-zero values we want to keep for the points is indexedValues.


hashValues

protected HashMap hashValues
Constructor Detail

ByteFeature

public ByteFeature()

ByteFeature

public ByteFeature(Experiments e,
                   byte[][] vals)
Parameters:
vals - a value for each (x,y) pair

ByteFeature

public ByteFeature(Experiments e,
                   int[] indexes,
                   byte[] vals)
Parameters:
indexes - The pairs (x,y) for which the feature is non-zero. They are coded as x*ySize+y
vals - The values at these points.
Method Detail

isEmpty

public boolean isEmpty()
Overrides:
isEmpty in class Feature
Returns:
true if the feature does not have non-zero values

getVal

public double getVal(int index)
Description copied from class: Feature
Get the value at the index-ed non zero value pair (x,y)

Overrides:
getVal in class Feature

ftiled

public double ftiled()
Overrides:
ftiled in class Feature
Returns:
the emptirical expectation of the feature


Stanford NLP Group