sbi-benchmark / sbibm

Simulation-based inference benchmark
https://sbi-benchmark.github.io
MIT License
89 stars 35 forks source link

PyTorch 1.8 compatibility and KDE warnings #8

Closed janfb closed 3 years ago

janfb commented 3 years ago

For context: This PR makes sbibm compatibe with the latest PyTorch version (1.8) necessary due to changes in their API of transformed distributions.

When using the identity transform in case of automatic_transforms_enabled=False, for SNPE, the support of the resulting TransformedDistribution becomes unbounded in PyTorch, even if the support of base distribution is bounded. This leads to wrong rejection sampling in sequential NPE with bounded support priors.

The PR fixes this by not wrapping the prior as TransformedDistribution in the run.py script. (This has the additional advantage that the prior is not wrapped and will be recognised "as is" by sbi, which is required for running SNPE with mixture density networks.)

The PR additionally extends the info when using KDE with ABC methods, see #7 .