cc.mallet.types
Class Multinomial.Logged

java.lang.Object
  extended by cc.mallet.types.SparseVector
      extended by cc.mallet.types.FeatureVector
          extended by cc.mallet.types.Multinomial
              extended by cc.mallet.types.Multinomial.Logged
All Implemented Interfaces:
AlphabetCarrying, ConstantMatrix, Vector, java.io.Serializable
Enclosing class:
Multinomial

public static class Multinomial.Logged
extends Multinomial

A Multinomial in which the values associated with each feature index fi is Math.log(probability[fi]) instead of probability[fi]. Logs are used for numerical stability.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class cc.mallet.types.Multinomial
Multinomial.Estimator, Multinomial.LaplaceEstimator, Multinomial.Logged, Multinomial.MAPEstimator, Multinomial.MEstimator, Multinomial.MLEstimator
 
Field Summary
 
Fields inherited from class cc.mallet.types.SparseVector
hasInfinite, indices, values
 
Constructor Summary
Multinomial.Logged(double[] probabilities)
           
Multinomial.Logged(double[] probabilities, Alphabet dictionary)
           
Multinomial.Logged(double[] probabilities, Alphabet dictionary, boolean areLoggedAlready)
           
Multinomial.Logged(double[] probabilities, Alphabet dictionary, int size)
           
Multinomial.Logged(double[] probabilities, Alphabet dictionary, int size, boolean areLoggedAlready)
           
Multinomial.Logged(Multinomial m)
           
 
Method Summary
 void addLogProbabilities(double[] vector)
           
 void addProbabilities(double[] vector)
           
 double logProbability(int featureIndex)
           
 double probability(int featureIndex)
           
 
Methods inherited from class cc.mallet.types.Multinomial
addProbabilitiesTo, getAlphabet, logProbability, probability, randomFeatureSequence, randomFeatureVector, randomIndex, randomObject, size
 
Methods inherited from class cc.mallet.types.FeatureVector
alphabetsMatch, cloneMatrix, cloneMatrixZeroed, contains, getAlphabets, getObjectIndices, location, newFeatureVector, toSimpFile, toString, toString, value
 
Methods inherited from class cc.mallet.types.SparseVector
absNorm, addTo, addTo, arrayCopyFrom, arrayCopyFrom, arrayCopyInto, dotProduct, dotProduct, dotProduct, dotProduct, extendedDotProduct, extendedDotProduct, getDimensions, getIndices, getNumDimensions, getValues, incrementValue, indexAtLocation, infinityNorm, isBinary, isInfinite, isNaN, isNaNOrInfinite, location, makeBinary, makeNonBinary, map, numLocations, oneNorm, plusEqualsSparse, plusEqualsSparse, print, removeDuplicates, setAll, setValue, setValueAtLocation, singleIndex, singleSize, singleToIndices, singleValue, sortIndices, timesEquals, timesEqualsSparse, timesEqualsSparse, timesEqualsSparseZero, twoNorm, value, value, valueAtLocation, vectorAdd
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Multinomial.Logged

public Multinomial.Logged(double[] probabilities,
                          Alphabet dictionary,
                          int size,
                          boolean areLoggedAlready)

Multinomial.Logged

public Multinomial.Logged(double[] probabilities,
                          Alphabet dictionary,
                          boolean areLoggedAlready)

Multinomial.Logged

public Multinomial.Logged(double[] probabilities,
                          Alphabet dictionary,
                          int size)

Multinomial.Logged

public Multinomial.Logged(double[] probabilities,
                          Alphabet dictionary)

Multinomial.Logged

public Multinomial.Logged(Multinomial m)

Multinomial.Logged

public Multinomial.Logged(double[] probabilities)
Method Detail

probability

public double probability(int featureIndex)
Overrides:
probability in class Multinomial

logProbability

public double logProbability(int featureIndex)
Overrides:
logProbability in class Multinomial

addProbabilities

public void addProbabilities(double[] vector)

addLogProbabilities

public void addLogProbabilities(double[] vector)