probcomp / metaprob

An embedded language for probabilistic programming and meta-programming.
GNU General Public License v3.0
168 stars 17 forks source link

Fix log-categorical #99

Closed alex-lew closed 5 years ago

alex-lew commented 5 years ago

This uses the log-sum-exp trick to normalize the log weights, avoiding divide by 0 when weights are very negative. It also fixes the scorer for log-categorical, which seemed to be calculating a CDF, rather than a PDF, before.