facebookresearch / beanmachine

A library that allows for inference on probabilistic models
https://beanmachine.org/
MIT License
264 stars 49 forks source link

Marginalization inference for multiple variables #1808

Closed rodrigodesalvobraz closed 1 year ago

rodrigodesalvobraz commented 1 year ago

Summary: Modify code to test whether variables are marginalizable without throwing an exception if they are not. Then use that to go over entire graph finding marginalizable variables and marginalizing each of them in sequence. Checking whether a variable is marginalizable is somewhat complex because we need to determine the set of deterministic nodes directly affected by it. Because this involves computing the entire support, we now cache that. We therefore also add a mechanism to cache this and to invalidate this cache whenever appropriate.

Reviewed By: gafter

Differential Revision: D40872470

facebook-github-bot commented 1 year ago

This pull request was exported from Phabricator. Differential Revision: D40872470