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

This commit is contained in:
AHN Sung Hwan
2024-04-11 11:34:44 +09:00
committed by GitHub
parent d21c45d0ea
commit 904a3cc8a9

View File

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