AHN Sung Hwan
Committed by GitHub

Fix a bug in mean calculation of 'ys_probs' (#748)

@@ -152,7 +152,7 @@ void TransducerKeywordDecoder::Decode( @@ -152,7 +152,7 @@ void TransducerKeywordDecoder::Decode(
152 if (matched) { 152 if (matched) {
153 float ys_prob = 0.0; 153 float ys_prob = 0.0;
154 int32_t length = best_hyp.ys_probs.size(); 154 int32_t length = best_hyp.ys_probs.size();
155 - for (int32_t i = 1; i <= matched_state->level; ++i) { 155 + for (int32_t i = 0; i < matched_state->level; ++i) {
156 ys_prob += best_hyp.ys_probs[i]; 156 ys_prob += best_hyp.ys_probs[i];
157 } 157 }
158 ys_prob /= matched_state->level; 158 ys_prob /= matched_state->level;