Package cc.mallet.types
Class Multinomial.Logged
- java.lang.Object
-
- cc.mallet.types.SparseVector
-
- cc.mallet.types.FeatureVector
-
- cc.mallet.types.Multinomial
-
- 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
Constructors Constructor Description Logged(double[] probabilities)
Logged(double[] probabilities, Alphabet dictionary)
Logged(double[] probabilities, Alphabet dictionary, boolean areLoggedAlready)
Logged(double[] probabilities, Alphabet dictionary, int size)
Logged(double[] probabilities, Alphabet dictionary, int size, boolean areLoggedAlready)
Logged(Multinomial m)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
-
-
-
-
Constructor Detail
-
Logged
public Logged(double[] probabilities, Alphabet dictionary, int size, boolean areLoggedAlready)
-
Logged
public Logged(double[] probabilities, Alphabet dictionary, boolean areLoggedAlready)
-
Logged
public Logged(double[] probabilities, Alphabet dictionary, int size)
-
Logged
public Logged(double[] probabilities, Alphabet dictionary)
-
Logged
public Logged(Multinomial m)
-
Logged
public Logged(double[] probabilities)
-
-
Method Detail
-
probability
public double probability(int featureIndex)
- Overrides:
probability
in classMultinomial
-
logProbability
public double logProbability(int featureIndex)
- Overrides:
logProbability
in classMultinomial
-
addProbabilities
public void addProbabilities(double[] vector)
-
addLogProbabilities
public void addLogProbabilities(double[] vector)
-
-