Examples of lookupMarginal()


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

    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) {
      // expected
      System.out.println ("OK: As expected, got exception "+e);
    }
View Full Code Here

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

        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);
          for (AssignmentIterator assnIt = vs.assignmentIterator (); assnIt.hasNext (); assnIt.advance ()) {
            if (marg.value (assnIt) > wrongWrongThreshold) {
              Assignment assn = assnIt.assignment ();
              for (int vi = 0; vi < vs.size (); vi++) {
                Variable var = vs.get (vi);
View Full Code Here

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

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

    for (int varnum = 0; varnum < allVars.length; varnum++) {
      Variable var = allVars[varnum];
      Factor ptl = inf.lookupMarginal (var);
      for (AssignmentIterator it = ptl.assignmentIterator (); it.hasNext (); it.advance()) {
        int outcome = it.indexOfCurrentAssn ();
        System.out.println (var+"  "+outcome+"   "+ptl.value (it));
      }
      System.out.println ();
View Full Code Here

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

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

    for (int varnum = 0; varnum < allVars.length; varnum++) {
      Variable var = allVars[varnum];
      Factor ptl = inf.lookupMarginal (var);
      for (AssignmentIterator it = ptl.assignmentIterator (); it.hasNext ();) {
        int outcome = it.indexOfCurrentAssn ();
        System.out.println (var+"  "+outcome+"   "+ptl.value (it));
      }
      System.out.println ();
View Full Code Here

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

    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) {
      // expected
      System.out.println ("OK: As expected, got exception "+e);
    }
View Full Code Here

Examples of cc.mallet.grmm.inference.JunctionTreeInferencer.lookupMarginal()

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

    for (int varnum = 0; varnum < allVars.length; varnum++) {
      Variable var = allVars[varnum];
      Factor ptl = inf.lookupMarginal (var);
      for (AssignmentIterator it = ptl.assignmentIterator (); it.hasNext (); it.advance()) {
        int outcome = it.indexOfCurrentAssn ();
        System.out.println (var+"  "+outcome+"   "+ptl.value (it));
      }
      System.out.println ();
View Full Code Here

Examples of cc.mallet.grmm.inference.JunctionTreeInferencer.lookupMarginal()

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

    for (int varnum = 0; varnum < allVars.length; varnum++) {
      Variable var = allVars[varnum];
      Factor ptl = inf.lookupMarginal (var);
      for (AssignmentIterator it = ptl.assignmentIterator (); it.hasNext ();) {
        int outcome = it.indexOfCurrentAssn ();
        System.out.println (var+"  "+outcome+"   "+ptl.value (it));
      }
      System.out.println ();
View Full Code Here

Examples of cc.mallet.grmm.inference.TRP.lookupMarginal()

    // check no exceptions thrown when asking for all marginals,
    //  and check that at least one factors' belief has changed
    //  from the choice at zero iterations.
    for (Iterator it = grid.factorsIterator (); it.hasNext();) {
      Factor f = (Factor) it.next ();
      Factor marg = trp.lookupMarginal (f.varSet ());// test no exception thrown
      if (!marg.almostEquals (f.duplicate ().normalize ())) {
        oneIsDifferent = true;
      }
    }
View Full Code Here

Examples of cc.mallet.grmm.inference.TRP.lookupMarginal()

    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) {
      // expected
      System.out.println ("OK: As expected, got exception "+e);
    }
View Full Code Here

Examples of cc.mallet.grmm.inference.TRP.lookupMarginal()

    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) {
      // expected
      System.out.println ("OK: As expected, got exception "+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.