|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.grmm.types.AbstractTableFactor cc.mallet.grmm.types.LogTableFactor
public class LogTableFactor
Created: Jan 4, 2006
Field Summary |
---|
Fields inherited from class cc.mallet.grmm.types.AbstractTableFactor |
---|
probs |
Constructor Summary | |
---|---|
LogTableFactor(AbstractTableFactor in)
|
|
LogTableFactor(java.util.Collection allVars)
|
|
LogTableFactor(Variable var)
|
|
LogTableFactor(Variable[] allVars)
|
Method Summary | |
---|---|
protected AbstractTableFactor |
createBlankSubset(Variable[] vars)
|
protected void |
divideByInternal(DiscreteFactor ptl)
|
Factor |
duplicate()
|
void |
exponentiate(double power)
|
Matrix |
getLogValueMatrix()
|
Matrix |
getValueMatrix()
|
double |
logsum()
|
double |
logValue(Assignment assn)
|
double |
logValue(AssignmentIterator it)
|
double |
logValue(int idx)
|
static LogTableFactor |
makeFromLogMatrix(Variable[] vars,
Matrix values)
|
static LogTableFactor |
makeFromLogValues(Variable[] vars,
double[] vals)
|
static LogTableFactor |
makeFromLogValues(Variable v,
double[] vals)
|
static LogTableFactor |
makeFromMatrix(Variable[] vars,
SparseMatrixn values)
|
static LogTableFactor |
makeFromValues(Variable[] vars,
double[] vals)
|
static LogTableFactor |
makeFromValues(Variable var,
double[] vals2)
|
protected Factor |
marginalizeInternal(AbstractTableFactor result)
|
static LogTableFactor |
multiplyAll(java.util.Collection phis)
|
protected void |
multiplyByInternal(DiscreteFactor ptl)
Does the conceptual equivalent of this *= pot. |
Factor |
normalize()
Multiplies this potential by a constant such that it sums to 1. |
protected void |
plusEqualsAtLocation(int loc,
double v)
|
protected void |
plusEqualsInternal(DiscreteFactor ptl)
Does the conceptual equivalent of this += pot. |
protected double |
rawValue(Assignment assn)
|
protected double |
rawValue(int singleIdx)
|
AbstractTableFactor |
recenter()
Multiplies this factor by the constant 1/max(). |
void |
setLogValue(Assignment assn,
double logValue)
Use of this method is discouraged. |
void |
setLogValue(AssignmentIterator assnIt,
double logValue)
Use of this method is discouraged. |
void |
setLogValues(double[] vals)
|
void |
setValue(AssignmentIterator assnIt,
double value)
Use of this method is discouraged. |
void |
setValues(double[] vals)
|
protected Factor |
slice_general(Variable[] vars,
Assignment observed)
|
protected Factor |
slice_onevar(Variable var,
Assignment observed)
|
protected Factor |
slice_twovar(Variable v1,
Variable v2,
Assignment observed)
|
double |
sum()
Returns the sum of this potential over all cases. |
void |
timesEquals(double v)
Multiplies a constant by all values in the table. |
double |
value(Assignment assn)
Returns the value of the local function for a given assignment. |
double |
value(AssignmentIterator it)
Returns the probability of an assignment to these variables. |
double |
value(int idx)
|
double |
valueAtLocation(int idx)
|
Methods inherited from class cc.mallet.grmm.types.AbstractTableFactor |
---|
almostEquals, almostEquals, argmax, assignmentIterator, asTable, clone, containsVar, divideBy, divideBy, dumpToString, ensureOperandCompatible, entropy, extractMax, extractMax, extractMax, findVariable, getNumVars, getValues, getVariable, indexAtLocation, isNaN, makeIdentityFactor, marginalize, marginalize, marginalize, marginalizeOut, marginalizeOut, multiply, multiplyBy, numLocations, plusEquals, plusEquals, prettyOutputString, printSizes, printValues, sample, sampleLocation, setRawValue, setRawValue, setRawValue, setValues, singleIndex, slice, toLogValueArray, toString, toValueArray, varSet |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LogTableFactor(AbstractTableFactor in)
public LogTableFactor(Variable var)
public LogTableFactor(Variable[] allVars)
public LogTableFactor(java.util.Collection allVars)
Method Detail |
---|
public static LogTableFactor makeFromValues(Variable[] vars, double[] vals)
public static LogTableFactor makeFromLogValues(Variable[] vars, double[] vals)
public Factor duplicate()
duplicate
in interface Factor
duplicate
in class AbstractTableFactor
protected AbstractTableFactor createBlankSubset(Variable[] vars)
createBlankSubset
in class AbstractTableFactor
public Factor normalize()
Factor
normalize
in interface Factor
normalize
in class AbstractTableFactor
public double sum()
Factor
sum
in interface Factor
sum
in class AbstractTableFactor
public double logsum()
logsum
in class AbstractTableFactor
protected void multiplyByInternal(DiscreteFactor ptl)
multiplyByInternal
in class AbstractTableFactor
protected void divideByInternal(DiscreteFactor ptl)
divideByInternal
in class AbstractTableFactor
protected void plusEqualsInternal(DiscreteFactor ptl)
plusEqualsInternal
in class AbstractTableFactor
public double value(Assignment assn)
Factor
value
in interface Factor
value
in class AbstractTableFactor
public double value(AssignmentIterator it)
Factor
This can be used to do things like
DiscretePotential phi = createMyPtl (); for (AssignmentIterator it = phi.assignmentIterator; it.hasNext(); it.advance()) { double val = ptl.phi (it); // do something with val }
This is equivalent to creating an assignment object explicitly using (Assignment) it.next(), but can be much faster.
public double value(int idx)
public double logValue(AssignmentIterator it)
public double logValue(int idx)
public double logValue(Assignment assn)
protected Factor marginalizeInternal(AbstractTableFactor result)
marginalizeInternal
in class AbstractTableFactor
protected double rawValue(Assignment assn)
protected double rawValue(int singleIdx)
rawValue
in class AbstractTableFactor
public void exponentiate(double power)
public void setLogValue(Assignment assn, double logValue)
AbstractTableFactor
setLogValue
in class AbstractTableFactor
public void setLogValue(AssignmentIterator assnIt, double logValue)
AbstractTableFactor
setLogValue
in class AbstractTableFactor
public void setValue(AssignmentIterator assnIt, double value)
AbstractTableFactor
setValue
in class AbstractTableFactor
public void setLogValues(double[] vals)
setLogValues
in class AbstractTableFactor
public void setValues(double[] vals)
setValues
in class AbstractTableFactor
public void timesEquals(double v)
AbstractTableFactor
timesEquals
in class AbstractTableFactor
protected void plusEqualsAtLocation(int loc, double v)
plusEqualsAtLocation
in class AbstractTableFactor
public static LogTableFactor makeFromValues(Variable var, double[] vals2)
public static LogTableFactor makeFromMatrix(Variable[] vars, SparseMatrixn values)
public static LogTableFactor makeFromLogMatrix(Variable[] vars, Matrix values)
public static LogTableFactor makeFromLogValues(Variable v, double[] vals)
public Matrix getValueMatrix()
getValueMatrix
in class AbstractTableFactor
public Matrix getLogValueMatrix()
getLogValueMatrix
in class AbstractTableFactor
public double valueAtLocation(int idx)
protected Factor slice_onevar(Variable var, Assignment observed)
slice_onevar
in class AbstractTableFactor
protected Factor slice_twovar(Variable v1, Variable v2, Assignment observed)
slice_twovar
in class AbstractTableFactor
protected Factor slice_general(Variable[] vars, Assignment observed)
slice_general
in class AbstractTableFactor
public static LogTableFactor multiplyAll(java.util.Collection phis)
public AbstractTableFactor recenter()
AbstractTableFactor
recenter
in class AbstractTableFactor
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |