Peng He
Committed by GitHub

Fix LogAdd (#316)

Using 0 as the initial value,  should not perform addition when both values are 0
... ... @@ -18,9 +18,11 @@ void Hypotheses::Add(Hypothesis hyp) {
} else {
it->second.log_prob = LogAdd<double>()(it->second.log_prob, hyp.log_prob);
if (it->second.lm_log_prob != 0 && hyp.lm_log_prob != 0){
it->second.lm_log_prob =
LogAdd<double>()(it->second.lm_log_prob, hyp.lm_log_prob);
}
}
}
Hypothesis Hypotheses::GetMostProbable(bool length_norm) const {
... ...