Package cc.mallet.grmm.types

Examples of cc.mallet.grmm.types.AssignmentIterator


        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;
        while (assnIt.hasNext ()) {
          double marginal = Math.exp (ptl.logValue (assnIt) - logZ);
          expectations [tidx][i].plusEqualsSparse (clique.getFv (), marginal);
          if (defaultExpectations[tidx].location (i) != -1)
            defaultExpectations [tidx].incrementValue (i, marginal);
          assnIt.advance (); i++;
        }

        value += (ptl.logValue (observations) - logZ);
      }
      return value;
View Full Code Here

TOP

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

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.