|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cc.mallet.grmm.types.AbstractFactor cc.mallet.grmm.types.ConstantFactor
public class ConstantFactor
$Id: ConstantFactor.java,v 1.1 2007/10/22 21:37:44 mccallum Exp $
Field Summary |
---|
Fields inherited from class cc.mallet.grmm.types.AbstractFactor |
---|
vars |
Constructor Summary | |
---|---|
ConstantFactor(double c)
|
Method Summary | |
---|---|
boolean |
almostEquals(Factor p,
double epsilon)
|
java.lang.String |
dumpToString()
|
Factor |
duplicate()
|
protected Factor |
extractMaxInternal(VarSet varSet)
|
boolean |
isNaN()
|
protected double |
lookupValueInternal(int i)
|
static Factor |
makeIdentityFactor()
|
protected Factor |
marginalizeInternal(VarSet varsToKeep)
|
Factor |
multiply(Factor other)
Returns the elementwise product of this factor with another. |
void |
multiplyBy(Factor other)
Does this *= pot. |
Factor |
normalize()
Multiplies this potential by a constant such that it sums to 1. |
Assignment |
sample(Randoms r)
Return an assignment sampled from this factor, interpreting it as an unnormalized probability distribution. |
Factor |
slice(Assignment assn)
|
java.lang.String |
toString()
|
double |
value(AssignmentIterator it)
Returns the probability of an assignment to these variables. |
Methods inherited from class cc.mallet.grmm.types.AbstractFactor |
---|
almostEquals, argmax, assignmentIterator, asTable, containsVar, delogify, divideBy, entropy, exponentiate, extractMax, extractMax, extractMax, getVariable, isInLogSpace, log, logify, logValue, logValue, logValue, marginalize, marginalize, marginalize, marginalizeOut, marginalizeOut, phi, prettyOutputString, setVarSet, sum, value, varSet |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConstantFactor(double c)
Method Detail |
---|
protected Factor extractMaxInternal(VarSet varSet)
extractMaxInternal
in class AbstractFactor
protected double lookupValueInternal(int i)
lookupValueInternal
in class AbstractFactor
protected Factor marginalizeInternal(VarSet varsToKeep)
marginalizeInternal
in class AbstractFactor
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.
value
in interface Factor
value
in class AbstractFactor
public Factor normalize()
Factor
public Assignment sample(Randoms r)
Factor
sample
in interface Factor
sample
in class AbstractFactor
public java.lang.String dumpToString()
public java.lang.String toString()
toString
in class java.lang.Object
public Factor slice(Assignment assn)
public Factor duplicate()
public boolean almostEquals(Factor p, double epsilon)
public boolean isNaN()
public Factor multiply(Factor other)
Factor
multiply
in interface Factor
multiply
in class AbstractFactor
public void multiplyBy(Factor other)
Factor
If both potentials are currently in log space, then does addition instead.
multiplyBy
in interface Factor
multiplyBy
in class AbstractFactor
public static Factor makeIdentityFactor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |