Committed by
GitHub
Fix a bug in mean calculation of 'ys_probs' (#748)
正在显示
1 个修改的文件
包含
1 行增加
和
1 行删除
| @@ -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; |
-
请 注册 或 登录 后发表评论