Package cc.mallet.grmm.types

Examples of cc.mallet.grmm.types.Factor.sum()


  public double computeNormalizationFactor (FactorGraph m) {
    /* What we'll do is get the unnormalized marginal of an arbitrary
     *  node; then sum the marginal to get the normalization factor. */
    Variable var = (Variable) m.variablesSet ().iterator().next();
    Factor marginal = unnormalizedMarginal (m, var);
    return marginal.sum ();
  }

  transient FactorGraph mdlCurrent;

  // Inert. All work done in lookupMarginal().
View Full Code Here


        ACRF.UnrolledVarSet clique = (ACRF.UnrolledVarSet) it.next();
        int tidx = clique.getTemplate().index;
        if (tidx == -1) continue;

        Factor ptl = unrolled.factorOf (clique);
        double logZ = Math.log (ptl.sum ());

        // for each assigment to the clique
        //  xxx SLOW this will need to be sparsified
        AssignmentIterator assnIt = clique.assignmentIterator ();
        int i = 0;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.