double gamma = gammas[ip][prev]; for (int ci = 0; ci < prevState.numDestinations(); ci++) { int curr = prevState.getDestinationState(ci).getIndex(); double dot = 0;
double gamma = gammas[ip][prev]; for (int ci = 0; ci < prevState.numDestinations(); ci++) { int curr = prevState.getDestinationState(ci).getIndex(); double dot = 0;
double gamma = gammas[ip][prev]; for (int ci = 0; ci < prevState.numDestinations(); ci++) { int curr = prevState.getDestinationState(ci).getIndex(); double dot = 0;
for (int ni = 0; ni < currState.numDestinations(); ni++){ int next= currState.getDestinationState(ni).getIndex(); nuBeta.plusEquals(lattice[ip+1][curr].beta[next]);
for (int ni = 0; ni < currState.numDestinations(); ni++){ int next= currState.getDestinationState(ni).getIndex(); nuBeta.plusEquals(lattice[ip+1][curr].beta[next]);
for (int ni = 0; ni < currState.numDestinations(); ni++){ int next= currState.getDestinationState(ni).getIndex(); nuBeta.plusEquals(lattice[ip+1][curr].beta[next]);
for (int si = 0; si < crf.numStates(); si++) { CRF.State prevState = (CRF.State)crf.getState(si); for (int di = 0; di < prevState.numDestinations(); di++) { int sj = prevState.getDestinationState(di).getIndex(); counts[sj]++; for (int si = 0; si < crf.numStates(); si++) { CRF.State prevState = (CRF.State)crf.getState(si); for (int di = 0; di < prevState.numDestinations(); di++) { int sj = prevState.getDestinationState(di).getIndex(); this.reverseTrans[sj][indices[sj]] = si;
for (int si = 0; si < crf.numStates(); si++) { CRF.State prevState = (CRF.State)crf.getState(si); for (int di = 0; di < prevState.numDestinations(); di++) { int sj = prevState.getDestinationState(di).getIndex(); counts[sj]++; for (int si = 0; si < crf.numStates(); si++) { CRF.State prevState = (CRF.State)crf.getState(si); for (int di = 0; di < prevState.numDestinations(); di++) { int sj = prevState.getDestinationState(di).getIndex(); this.reverseTrans[sj][indices[sj]] = si;
for (int si = 0; si < crf.numStates(); si++) { CRF.State prevState = (CRF.State)crf.getState(si); for (int di = 0; di < prevState.numDestinations(); di++) { int sj = prevState.getDestinationState(di).getIndex(); counts[sj]++; for (int si = 0; si < crf.numStates(); si++) { CRF.State prevState = (CRF.State)crf.getState(si); for (int di = 0; di < prevState.numDestinations(); di++) { int sj = prevState.getDestinationState(di).getIndex(); this.reverseTrans[sj][indices[sj]] = si;
protected CachedDotTransitionIterator(State source, Object fv, String output, double[] dots) { this.source = source; this.input = fv; this.weights = new double[source.numDestinations()]; for (int i = 0; i < source.numDestinations(); i++) { weights[i] = dots[source.getDestinationState(i).getIndex()]; } // Prepare nextIndex, pointing at the next non-impossible transition nextIndex = 0; while (nextIndex < source.numDestinations() && weights[nextIndex] == Transducer.IMPOSSIBLE_WEIGHT) nextIndex++; }
public boolean hasNext() { return nextIndex < source.numDestinations(); }
protected CachedDotTransitionIterator(State source, Object fv, String output, double[] dots) { this.source = source; this.input = fv; this.weights = new double[source.numDestinations()]; for (int i = 0; i < source.numDestinations(); i++) { weights[i] = dots[source.getDestinationState(i).getIndex()]; } // Prepare nextIndex, pointing at the next non-impossible transition nextIndex = 0; while (nextIndex < source.numDestinations() && weights[nextIndex] == Transducer.IMPOSSIBLE_WEIGHT) nextIndex++; }
protected CachedDotTransitionIterator(State source, Object fv, String output, double[] dots) { this.source = source; this.input = fv; this.weights = new double[source.numDestinations()]; for (int i = 0; i < source.numDestinations(); i++) { weights[i] = dots[source.getDestinationState(i).getIndex()]; } // Prepare nextIndex, pointing at the next non-impossible transition nextIndex = 0; while (nextIndex < source.numDestinations() && weights[nextIndex] == Transducer.IMPOSSIBLE_WEIGHT) nextIndex++; }
public boolean hasNext() { return nextIndex < source.numDestinations(); }
public boolean hasNext() { return nextIndex < source.numDestinations(); }
public Transducer.State nextState() { assert (nextIndex < source.numDestinations()); index = nextIndex; nextIndex++; while (nextIndex < source.numDestinations() && weights[nextIndex] == Transducer.IMPOSSIBLE_WEIGHT) nextIndex++; return source.getDestinationState(index); }
public Transducer.State nextState() { assert (nextIndex < source.numDestinations()); index = nextIndex; nextIndex++; while (nextIndex < source.numDestinations() && weights[nextIndex] == Transducer.IMPOSSIBLE_WEIGHT) nextIndex++; return source.getDestinationState(index); }
public Transducer.State nextState() { assert (nextIndex < source.numDestinations()); index = nextIndex; nextIndex++; while (nextIndex < source.numDestinations() && weights[nextIndex] == Transducer.IMPOSSIBLE_WEIGHT) nextIndex++; return source.getDestinationState(index); }