april-tools / cirkit

a python framework to build, learn and reason about probabilistic circuits and tensor networks
https://cirkit-docs.readthedocs.io/en/latest/
GNU General Public License v3.0
71 stars 1 forks source link

Marginalization mask #292

Open mlnpapez opened 3 days ago

mlnpapez commented 3 days ago

Hi,

The current implementation of the marginal query (https://github.com/april-tools/cirkit/blob/fb4554c5e8b418611115d2c56538e5ac67cf31c4/cirkit/backend/torch/queries.py#L19C7-L19C21) integrates all samples in the minibatch for the same set of indices. Would it be possible to apply a different set of indices for each sample in the minibatch? For example, it would be nice to have an option to use a marginalization mask (with a size equal to the minibatch).

Best regards, Milan