This is nothing crucial, but I have a small suggestion for clarity. In the part that introduces the implementation of the mixture model (using log_sum_exp()), I think the exposition could be made a bit more uncompressed:
we have a problem of computing log(A+B)
for numerical stability we cannot just add that, we need a hack: log(A+B) = log_sum_exp(log(A), log(B))
log(A) = log(p_task*pdf1) = log(p) + llpdf1 (and remind that we were always dealing with lpdfs not pdfs)
and then by the way we also need to deal with log(1-p) in a stabile way, --> log1m()
so we end up with: log_sum_exp(llog(p) + llpdf1, log1m(p) + llpdf2)
even though I was familiar with LSE and log1m, it took me a while to reconstruct this and parse why this works in this way.
I assume a typical reader won't know LSE, be unfamiliar with transitions between log and lin scales, and be math-anxious, so being super explicit might help.
One part I found confusing was the mention that LSE = log(exp(x) + exp(y)), even though there were no exp()s in the formulas above that part of the text.
More generally, whenever I don't understand something in math, it makes me less motivated to understand anything that follows it, so I always appreciate it that whenever I'm exposed to math (because there is no other way around), it is presented in an explicit way.
This is nothing crucial, but I have a small suggestion for clarity. In the part that introduces the implementation of the mixture model (using
log_sum_exp()
), I think the exposition could be made a bit more uncompressed:even though I was familiar with LSE and log1m, it took me a while to reconstruct this and parse why this works in this way. I assume a typical reader won't know LSE, be unfamiliar with transitions between log and lin scales, and be math-anxious, so being super explicit might help.
One part I found confusing was the mention that LSE = log(exp(x) + exp(y)), even though there were no exp()s in the formulas above that part of the text.
More generally, whenever I don't understand something in math, it makes me less motivated to understand anything that follows it, so I always appreciate it that whenever I'm exposed to math (because there is no other way around), it is presented in an explicit way.