facebookincubator / flowtorch

This library would form a permanent home for reusable components for deep probabilistic programming. The library would form and harness a community of users and contributors by focusing initially on complete infra and documentation for how to use and create components.
https://flowtorch.ai
MIT License
301 stars 21 forks source link

Invertible conditional flows #81

Closed kirtanp closed 2 years ago

kirtanp commented 2 years ago

Issue Description (feature request)

Does flowtorch already support invertible conditional flows? That is, learning p(x | z). And given x and z, we get back the value sampled from the base distribution. Is there a reasonable way to do this already and if not, is it planned be supported any time soon? Thanks!

stefanwebb commented 2 years ago

@kirtanp thanks for the great question! First I can say that adding conditional flows is one of the highest items on our implementation agenda. We had to take it out after a major refactor and haven't gotten around to putting it back in yet.

Separately, you can get the value sampled from the base distribution for analytically invertible flows with the .normalize() and .rnormalize() methods of Flow, which work independently from conditionality. See here: https://github.com/facebookincubator/flowtorch/blob/main/flowtorch/distributions/flow.py