Package cc.mallet.grmm.types

Examples of cc.mallet.grmm.types.VarSet


      g.addVertex (var);
    }

    for (Iterator it = fg.factorsIterator (); it.hasNext ();) {
      Factor factor = (Factor) it.next ();
      VarSet varSet = factor.varSet ();
      int nv = varSet.size ();
      for (int i = 0; i < nv; i++) {
        for (int j = i + 1; j < nv; j++) {
          g.addEdge (varSet.get (i), varSet.get (j));
        }
      }
    }

    return g;
View Full Code Here


  public Factor lookupMarginal (JunctionTree jt, Variable var)
  {
    if (jt == null) { throw new IllegalStateException ("Call computeMarginals() first."); }

    VarSet parent = jt.findParentCluster (var);
    Factor cpf = jt.getCPF (parent);
    if (logger.isLoggable (Level.FINER)) {
      logger.finer ("Lookup jt marginal: var " + var + " cluster " + parent);
      logger.finest (" cpf " + cpf);
    }
View Full Code Here

  // bottom-up pass
  private void collectEvidence (JunctionTree jt, VarSet parent, VarSet child)
  {
    logger.finer ("collectEvidence " + parent + " --> " + child);
    for (Iterator it = jt.getChildren (child).iterator (); it.hasNext ();) {
      VarSet gchild = (VarSet) it.next ();
      collectEvidence (jt, child, gchild);
    }
    if (parent != null) {
      totalMessagesSent++;
      strategy.sendMessage (jt, child, parent);
View Full Code Here

  // top-down pass
  private void distributeEvidence (JunctionTree jt, VarSet parent)
  {
    for (Iterator it = jt.getChildren (parent).iterator (); it.hasNext ();) {
      VarSet child = (VarSet) it.next ();
      totalMessagesSent++;
      strategy.sendMessage (jt, parent, child);
      distributeEvidence (jt, child);
    }
  }
View Full Code Here

    }
  }

  private void propagate (JunctionTree jt)
  {
    VarSet root = (VarSet) jt.getRoot ();
    collectEvidence (jt, null, root);
    distributeEvidence (jt, root);
  }
View Full Code Here

  public Factor lookupMarginal (JunctionTree jt, VarSet varSet)
  {
    if (jt == null) { throw new IllegalStateException ("Call computeMarginals() first."); }

    VarSet parent = jt.findParentCluster (varSet);
    if (parent == null) {
      throw new UnsupportedOperationException
              ("No parent cluster in " + jt + " for clique " + varSet);
    }
View Full Code Here

TOP

Related Classes of cc.mallet.grmm.types.VarSet

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.