pyro-ppl / funsor

Functional tensors for probabilistic programming
https://funsor.pyro.ai
Apache License 2.0
236 stars 20 forks source link

Provenance funsor #593

Open ordabayevy opened 2 years ago

ordabayevy commented 2 years ago

Provenance tracking implementation in funsor. Here the provenance is the set of (name, point) tuples of RV samples that were in the history of the computations of the tracked term. Substitution results in the multiplication by the density:

>>> logp_x = Provenance(logp_value, {("x", point)})
>>> logp_x(x=point)
logp_value

The Provenance funsor is intended to be used in https://github.com/pyro-ppl/pyro/pull/2893 as a wrapper for ProvenanceTensor.

ordabayevy commented 2 years ago

Tests are failing due to the new jax version #594