he
log scale. It is defined for two inputs by</p>
<p><span class="math display">\[
\mbox{log\_sum\_exp}(a, b) = \log (\exp(a) + \exp(b)).
\]</span></p>
<p>If <span class="math inline">\(a\)</span> and <span class="math inline">\(b\)</span> are probabilities on the log scale, then <span class="math inline">\(\exp(a) + \exp(b)\)</span> is their sum on the linear scale, and the outer log converts
the result back to the log scale; to summarize, log_sum_exp does
linear addition on the log scale. The reason to us