Examples of aligned()


Examples of edu.umd.hooka.Alignment.aligned()

    //if (true) return;
    PerplexityReporter cr = new PerplexityReporter();
    Alignment a = hmm.viterbiAlign(pp, cr);
    double ce1 = cr.getCrossEntropy();
    System.out.println(a.toStringVisual() + "\n"+cr);
    assertTrue(a.aligned(0, 0));
    System.out.println(hmm.backtrace);
    hmm = new HMM(tc, ac);
    hmm.buildHMMTables(pp);
    cr.reset();
    a = hmm.viterbiAlign(pp, cr);
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

        boolean use_m1 = false;
        if (m1a != null && m1a.isFAligned(j-1)) {
          float m1post = 0.0f;
          use_m1 = true;
          for (int i=0; i<l; i++)
            if (m1a.aligned(j-1, i))
              m1post = m1_post.getAlignmentPointPosterior(j-1, i+1);
          m1boost = (float)(Math.sqrt(m1post));
          m1penalty = 1.0f - m1boost;
        }
        for (int s_next = 0; s_next < numStates; s_next++) {
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

        for (int s_next = 0; s_next < numStates; s_next++) {
          //System.out.println("    s_next="+s_next + " b(j+1,s_next)="+ betas.get(j+1, s_next) + " * " +
          //    hmm.getTransitionProb(s, s_next) + " * " + hmm.getEmissionProb(s_next, j));
          float trans = getTransitionProb(s, s_next);
          if (use_m1) {
            if (s <= l && s > 0 && m1a.aligned(j-1, s-1))
              trans = m1boost;
            else
              trans *= m1penalty;
          }
          beta += betas.get(j+1, s_next) *
 
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

            boolean use_m1 = false;
            if (m1a != null && m1a.isFAligned(j-1)) {
              float m1post = 0.0f;
              use_m1 = true;
              for (int i=0; i<l; i++)
                if (m1a.aligned(j-1, i))
                  m1post = m1_post.getAlignmentPointPosterior(j-1, i+1);
              m1boost = (float)(Math.sqrt(m1post));
              m1penalty = 1.0f - m1boost;
            }
            float trans = getTransitionProb(s_prev, s);
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

              m1boost = (float)(Math.sqrt(m1post));
              m1penalty = 1.0f - m1boost;
            }
            float trans = getTransitionProb(s_prev, s);
            if (use_m1) {
              if (s <= l && s > 0 && m1a.aligned(j-1, s-1))
                trans = m1boost;
              else
                trans *= m1penalty;
            }
            // SKIPPING: REMOVE!!!
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

          boolean use_m1 = false;
          if (m1a != null && m1a.isFAligned(j-1)) {
            float m1post = 0.0f;
            use_m1 = true;
            for (int i=0; i<lene; i++) {
              if (m1a.aligned(j-1, i))
                m1post = m1_post.getAlignmentPointPosterior(j-1, i+1);
            }
            m1boost = (float)Math.sqrt(m1post);
            m1penalty = 1.0f - m1boost;
          }
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

            m1boost = (float)Math.sqrt(m1post);
            m1penalty = 1.0f - m1boost;
          }
          float trans = getTransitionProb(s_prev, s);
          if (use_m1) {
            if (s <= l && s > 0 && m1a.aligned(j-1, s-1))
              trans = m1boost;
            else
              trans *= m1penalty;
          }
          float cur = (float)(viterbi.get(j - 1, s_prev) +
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

        boolean use_m1 = false;
        if (m1a != null && m1a.isFAligned(j-1)) {
          float m1post = 0.0f;
          use_m1 = true;
          for (int i=0; i<l; i++)
            if (m1a.aligned(j-1, i))
              m1post = m1_post.getAlignmentPointPosterior(j-1, i+1);
          //System.out.println(m1post);
          m1boost = (float)(Math.sqrt(m1post));
          m1penalty = 1.0f - m1boost;
        }
View Full Code Here

Examples of edu.umd.hooka.Alignment.aligned()

          m1penalty = 1.0f - m1boost;
        }
        for (int s_prev = 0; s_prev < numStates; s_prev++) {
          float trans = getTransitionProb(s_prev, s);
          if (use_m1) {
            if (s <= l && s > 0 && m1a.aligned(j-1, s-1))
              trans = m1boost;
            else
              trans *= m1penalty;
          }
          alpha += alphas.get(j - 1, s_prev) * trans;
 
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.