|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcc.mallet.grmm.util.Models
public class Models
Static utilities that do useful things with factor graphs. Created: Sep 22, 2005
| Constructor Summary | |
|---|---|
Models()
|
|
| Method Summary | |
|---|---|
static FactorGraph |
addEvidence(FactorGraph mdl,
Assignment assn)
Returns a new factor graph, the same as a given one, except that all the nodes in the given Assignment are clamped as evidence. |
static FactorGraph |
addEvidence(FactorGraph mdl,
Assignment assn,
java.util.Map toSlicedMap)
|
static UndirectedModel |
addEvidence(UndirectedModel mdl,
Assignment assn)
|
static Assignment |
bestAssignment(FactorGraph mdl,
Inferencer inf)
Returns the highest-score Assignment in a model according to a given inferencer. |
static double |
entropy(FactorGraph mdl)
Computes the exact entropy of a factor graph distribution using the junction tree algorithm. |
static double |
KL(FactorGraph mdl1,
FactorGraph mdl2)
Computes the KL divergence KL(mdl1||mdl2). |
static void |
removeConstantFactors(FactorGraph sliced)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Models()
| Method Detail |
|---|
public static FactorGraph addEvidence(FactorGraph mdl,
Assignment assn)
mdl - Old model. Will not be modified.assn - Evidence to add
public static FactorGraph addEvidence(FactorGraph mdl,
Assignment assn,
java.util.Map toSlicedMap)
public static UndirectedModel addEvidence(UndirectedModel mdl,
Assignment assn)
public static Assignment bestAssignment(FactorGraph mdl,
Inferencer inf)
mdl - Factor graph to useinf - Inferencer to use. No need to call computeMarginals first.
public static double entropy(FactorGraph mdl)
public static double KL(FactorGraph mdl1,
FactorGraph mdl2)
TODO: This probably won't handle when the jnuction tree for MDL2 contains a clique that's not present in the junction tree for mdl1. If so, this is a bug.
mdl1 - mdl2 -
public static void removeConstantFactors(FactorGraph sliced)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||