Open riastradh-probcomp opened 9 years ago
Which is sad, because that operation is called sampleLogCategorical (in the Venture codebase), and it really should subtract off the maximum of the cluster_logps before starting to exponentiate them, lest loss of precision lead to bad results or crashes.
Separately, it probably shouldn't use numpy's ambient prng for its entropy, but that feels like a more involved problem.
Use of numpy's entropy is now issue #56.
simple_predictive_sample_unobserved
(https://github.com/probcomp/crosscat/blob/b0a7c1a8e150d4c918d7c3a0325a09282cc7ae7e/crosscat/utils/sample_utils.py#L547-L549) does this: