private void dumpOneGraph (UnrolledGraph unrolled) { Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { UnrolledVarSet clique = (UnrolledVarSet) it.next(); System.out.println("Clique "+clique); // dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); if (ptl != null) System.out.println (ptl); } }
private void dumpOneGraph (UnrolledGraph unrolled) { Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { UnrolledVarSet clique = (UnrolledVarSet) it.next(); System.out.println("Clique "+clique); // dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); if (ptl != null) System.out.println (ptl); } }
private void dumpOneGraph (UnrolledGraph unrolled) { Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { UnrolledVarSet clique = (UnrolledVarSet) it.next(); System.out.println("Clique "+clique); // dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); if (ptl != null) System.out.println (ptl); } }
/** Adds FACTOR to this graph, but while maintaining the invariant that every set of variables has * at most one factor over exactly that domain. If the given FACTOR has a domain that is already * used by some other factor PREV, then PREV is replaced with a FactorGraph containing PREV and FACTOR. * @param clique * @param factor The factor to add */ private void addFactorInternal (UnrolledVarSet clique, Factor factor) { clique.setFactor (factor); Factor prevFactor = factorOf (factor.varSet ()); if (prevFactor == null) { addFactor (factor); } else if (prevFactor instanceof FactorGraph) { prevFactor.multiplyBy (factor); } else { divideBy (prevFactor); addFactor (new FactorGraph (new Factor[] { factor, prevFactor })); } }
/** Adds FACTOR to this graph, but while maintaining the invariant that every set of variables has * at most one factor over exactly that domain. If the given FACTOR has a domain that is already * used by some other factor PREV, then PREV is replaced with a FactorGraph containing PREV and FACTOR. * @param clique * @param factor The factor to add */ private void addFactorInternal (UnrolledVarSet clique, Factor factor) { clique.setFactor (factor); Factor prevFactor = factorOf (factor.varSet ()); if (prevFactor == null) { addFactor (factor); } else if (prevFactor instanceof FactorGraph) { prevFactor.multiplyBy (factor); } else { divideBy (prevFactor); addFactor (new FactorGraph (new Factor[] { factor, prevFactor })); } }
public void advance () { vidx++; Variable var = graph.get (vidx); ptl = new TableFactor (var); for (Iterator it = cliquesByVar[vidx].iterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next (); Factor cliquePtl = graph.factorOf (clique); if (cliquePtl == null) throw new IllegalStateException ("Could not find potential for clique "+clique); VarSet vs = new HashVarSet (cliquePtl.varSet ()); vs.remove (var); Assignment nbrAssn = (Assignment) observed.marginalize (vs); Factor slice = cliquePtl.slice (nbrAssn); ptl.multiplyBy (slice); } }
public void advance () { vidx++; Variable var = graph.get (vidx); ptl = new TableFactor (var); for (Iterator it = cliquesByVar[vidx].iterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next (); Factor cliquePtl = graph.factorOf (clique); if (cliquePtl == null) throw new IllegalStateException ("Could not find potential for clique "+clique); VarSet vs = new HashVarSet (cliquePtl.varSet ()); vs.remove (var); Assignment nbrAssn = (Assignment) observed.marginalize (vs); Factor slice = cliquePtl.slice (nbrAssn); ptl.multiplyBy (slice); } }
public void advance () { vidx++; Variable var = graph.get (vidx); ptl = new TableFactor (var); for (Iterator it = cliquesByVar[vidx].iterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next (); Factor cliquePtl = graph.factorOf (clique); if (cliquePtl == null) throw new IllegalStateException ("Could not find potential for clique "+clique); VarSet vs = new HashVarSet (cliquePtl.varSet ()); vs.remove (var); Assignment nbrAssn = (Assignment) observed.marginalize (vs); Factor slice = cliquePtl.slice (nbrAssn); ptl.multiplyBy (slice); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.varSetIterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext ();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next (); System.out.println ("Clique " + clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println ("Value = " + ptl.value (assn)); System.out.println (ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (UnrolledGraph unrolled) { print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { UnrolledVarSet clique = (UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext ();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next (); System.out.println ("Clique " + clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println ("Value = " + ptl.value (assn)); System.out.println (ptl); } }
void printDebugInfo (UnrolledGraph unrolled) { print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { UnrolledVarSet clique = (UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.varSetIterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.varSetIterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (UnrolledGraph unrolled) { print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext();) { UnrolledVarSet clique = (UnrolledVarSet) it.next(); System.out.println("Clique "+clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println("Value = "+ptl.value (assn)); System.out.println(ptl); } }
void printDebugInfo (ACRF.UnrolledGraph unrolled) { acrf.print (System.err); Assignment assn = unrolled.getAssignment (); for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext ();) { ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next (); System.out.println ("Clique " + clique); dumpAssnForClique (assn, clique); Factor ptl = unrolled.factorOf (clique); System.out.println ("Value = " + ptl.value (assn)); System.out.println (ptl); } }