Package cc.mallet.grmm.inference

Examples of cc.mallet.grmm.inference.Inferencer.computeMarginals()


  {
    FactorGraph fg = createBoltzmannChain (5);
    Assignment assn = fg.sampleContinuousVars (new Randoms (23423));
    FactorGraph sliced = (FactorGraph) fg.slice (assn);
    Inferencer bp = new TRP ();
    bp.computeMarginals (sliced);

    try {
      bp.lookupMarginal (new Variable (2));
      fail ("Expected exception");
    } catch (IllegalArgumentException e) {
View Full Code Here


    double total = 0;
    Inferencer inf = acrf.getInferencer ();
    for (int i = 0; i < trainingList.size (); i++) {
      Instance inst = trainingList.get (i);
      ACRF.UnrolledGraph unrolled = acrf.unroll (inst);
      inf.computeMarginals (unrolled);
      double lik = inf.lookupLogJoint (unrolled.getAssignment ());
      total += lik;
      logger.info ("...instance "+i+" likelihood = "+lik);
    }
    logger.info ("Unregularized joint likelihood = "+total);
View Full Code Here

          System.err.println ("WARNING: FactorGraph for instance " + instance.getName () + " : no factors.");
          continue;
        }

        Inferencer inf = acrf.getInferencer ();
        inf.computeMarginals (unrolled);

        Assignment target = unrolled.getAssignment ();
        for (Iterator it = unrolled.unrolledVarSetIterator (); it.hasNext ();) {
          ACRF.UnrolledVarSet vs = (ACRF.UnrolledVarSet) it.next ();
          Factor marg = inf.lookupMarginal (vs);
View Full Code Here

    }

    // STEP 2: Compute marginals

    Inferencer inf = new JunctionTreeInferencer ();
    inf.computeMarginals (mdl);

    // STEP 3: Collect the results
    //   We'll just print them out

    for (int varnum = 0; varnum < allVars.length; varnum++) {
View Full Code Here

    }

    // STEP 2: Compute marginals

    Inferencer inf = new JunctionTreeInferencer ();
    inf.computeMarginals (mdl);

    // STEP 3: Collect the results
    //   We'll just print them out

    for (int varnum = 0; varnum < allVars.length; varnum++) {
View Full Code Here

  {
    FactorGraph fg = createBoltzmannChain (5);
    Assignment assn = fg.sampleContinuousVars (new Randoms (23423));
    FactorGraph sliced = (FactorGraph) fg.slice (assn);
    Inferencer bp = new TRP ();
    bp.computeMarginals (sliced);

    try {
      bp.lookupMarginal (new Variable (2));
      fail ("Expected exception");
    } catch (IllegalArgumentException e) {
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.