Package cc.mallet.grmm.types

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


      Factor fromCpf = jt.getCPF (from);
      Factor toCpf = jt.getCPF (to);
      Factor oldSepsetPot = jt.getSepsetPot (from, to);
      Factor lambda = fromCpf.marginalize (sepset);

      lambda.normalize ();

      jt.setSepsetPot (lambda, from, to);
      toCpf = toCpf.multiply (lambda);
      toCpf.divideBy (oldSepsetPot);
      toCpf.normalize ();
View Full Code Here


      Factor fromCpf = jt.getCPF (from);
      Factor toCpf = jt.getCPF (to);
      Factor oldSepsetPot = jt.getSepsetPot (from, to);
      Factor lambda = fromCpf.extractMax (sepset);

      lambda.normalize ();

      jt.setSepsetPot (lambda, from, to);
      toCpf = toCpf.multiply (lambda);
      toCpf.divideBy (oldSepsetPot);
      toCpf.normalize ();
View Full Code Here

  }

  public Factor lookupMarginal (Variable var)
  {
    Factor marginal = unnormalizedMarginal (mdlCurrent, var);
    marginal.normalize();
    return marginal;
  }

  // Serialization
  private static final long serialVersionUID = 1;
View Full Code Here

      logger.finer ("Lookup jt marginal: clique " + varSet + " cluster " + parent);
      logger.finest ("  cpf " + cpf);
    }

    Factor marginal = strategy.extractBelief (cpf, varSet);
    marginal.normalize ();

    return marginal;
  }

  public Factor lookupMarginal (JunctionTree jt, Variable var)
View Full Code Here

      logger.finer ("Lookup jt marginal: var " + var + " cluster " + parent);
      logger.finest (" cpf " + cpf);
    }

    Factor marginal = strategy.extractBelief (cpf, new HashVarSet (new Variable[] { var }));
    marginal.normalize ();

    return marginal;
  }

  ///////////////////////////////////////////////////////////////////////////
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.