probsys / sppl

Probabilistic programming system for fast and exact symbolic inference
Apache License 2.0
76 stars 10 forks source link

Remove prune_events from BranchSPN and make ProductSPN check for conjunctions first #57

Closed fsaad closed 4 years ago

fsaad commented 4 years ago

Rather than iterate through all 2^m subsets, first compute the probabilities of the m conjunctions and immediately return 0 if each conjunction in the union has probability zero, which removes the duplicate computation inside prune_events.

fsaad commented 4 years ago

Implemented in https://github.com/probcomp/sum-product-dsl/commit/4ac7d47255f9057deb01ddf1c70f9bb17e73e766 for logprob---condition is more complicated, since finding the disjoint union is often more expensive than the linear pruning, plus we already memoize those computations