double weight = lattice[ip][i].delta + iter.getWeight(); if (ip == latticeLength-2) { weight += destination.getFinalWeight();
double weight = lattice[ip][i].delta + iter.getWeight(); if (ip == latticeLength-2) { weight += destination.getFinalWeight();
double weight = lattice[ip][i].delta + iter.getWeight(); if (ip == latticeLength-2) { weight += destination.getFinalWeight();
(nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - weight;
totalWeight = Transducer.sumLogProb (totalWeight, (nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - totalWeight; if (incrementor != null) {
totalWeight = Transducer.sumLogProb (totalWeight, (nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - totalWeight; if (incrementor != null) {
totalWeight = Transducer.sumLogProb (totalWeight, (nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - totalWeight; if (incrementor != null) {
totalWeight = Transducer.sumLogProb (totalWeight, (nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - totalWeight; if (incrementor != null) {
if (constraints[latticeLength-1] < 0 && -i == constraints[latticeLength-1]+1) continue; logger.fine ("Summing final lattice weight. state="+i+", alpha="+nodes[latticeLength-1][i].alpha + ", final weight = "+t.getState(i).getFinalWeight()); totalWeight = Transducer.sumLogProb (totalWeight, (nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - totalWeight;
Z = 0; Z += nodes[latticeLength - 1][i].alpha * Math.exp(t.getState(i).getFinalWeight()); if (nodes[latticeLength - 1][i] != null) { State s = t.getState(i); nodes[latticeLength - 1][i].beta = Math.exp(s.getFinalWeight()); double gamma = nodes[latticeLength - 1][i].alpha * nodes[latticeLength - 1][i].beta / Z;
if (nodes[latticeLength-1][i] != null) { totalWeight = Transducer.sumLogProb(totalWeight, (nodes[latticeLength-1][i].alpha + transducer.getState(i).getFinalWeight())); if (nodes[latticeLength - 1][i] != null) { State s = transducer.getState(i); nodes[latticeLength - 1][i].beta = s.getFinalWeight(); gammas[latticeLength - 1][i] = nodes[latticeLength - 1][i].alpha + nodes[latticeLength - 1][i].beta - totalWeight;
totalWeight = Transducer.sumLogProb (totalWeight, (nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - totalWeight; if (incrementor != null) {
totalWeight = Transducer.sumLogProb (totalWeight, (nodes[latticeLength-1][i].alpha + t.getState(i).getFinalWeight())); if (nodes[latticeLength-1][i] != null) { State s = t.getState(i); nodes[latticeLength-1][i].beta = s.getFinalWeight(); gammas[latticeLength-1][i] = nodes[latticeLength-1][i].alpha + nodes[latticeLength-1][i].beta - totalWeight; if (incrementor != null) {
Z = 0; Z += nodes[latticeLength - 1][i].alpha * Math.exp(t.getState(i).getFinalWeight()); if (nodes[latticeLength - 1][i] != null) { State s = t.getState(i); nodes[latticeLength - 1][i].beta = Math.exp(s.getFinalWeight()); double gamma = nodes[latticeLength - 1][i].alpha * nodes[latticeLength - 1][i].beta / Z;
if (nodes[latticeLength-1][i] != null) { totalWeight = Transducer.sumLogProb(totalWeight, (nodes[latticeLength-1][i].alpha + transducer.getState(i).getFinalWeight())); if (nodes[latticeLength - 1][i] != null) { State s = transducer.getState(i); nodes[latticeLength - 1][i].beta = s.getFinalWeight(); gammas[latticeLength - 1][i] = nodes[latticeLength - 1][i].alpha + nodes[latticeLength - 1][i].beta - totalWeight;
Z = 0; Z += nodes[latticeLength - 1][i].alpha * Math.exp(t.getState(i).getFinalWeight()); if (nodes[latticeLength - 1][i] != null) { State s = t.getState(i); nodes[latticeLength - 1][i].beta = Math.exp(s.getFinalWeight()); double gamma = nodes[latticeLength - 1][i].alpha * nodes[latticeLength - 1][i].beta / Z;
if (nodes[latticeLength-1][i] != null) { totalWeight = Transducer.sumLogProb(totalWeight, (nodes[latticeLength-1][i].alpha + transducer.getState(i).getFinalWeight())); if (nodes[latticeLength - 1][i] != null) { State s = transducer.getState(i); nodes[latticeLength - 1][i].beta = s.getFinalWeight(); gammas[latticeLength - 1][i] = nodes[latticeLength - 1][i].alpha + nodes[latticeLength - 1][i].beta - totalWeight;
if (t.getState(i).getFinalWeight() == Transducer.IMPOSSIBLE_WEIGHT) continue; if (finalProbs != null) { totalWeight += finalProbs[i] * t.getState(i).getFinalWeight(); if (incrementor != null) incrementor.incrementFinalState(t.getState(i),
if (t.getState(i).getFinalWeight() == Transducer.IMPOSSIBLE_WEIGHT) continue; if (finalProbs != null) { totalWeight += finalProbs[i] * t.getState(i).getFinalWeight(); if (incrementor != null) incrementor.incrementFinalState(t.getState(i),
if (t.getState(i).getFinalWeight() == Transducer.IMPOSSIBLE_WEIGHT) continue; if (finalProbs != null) { totalWeight += finalProbs[i] * t.getState(i).getFinalWeight(); if (incrementor != null) incrementor.incrementFinalState(t.getState(i),