htjb / margarine

Code to replicate posterior probability distributions with bijectors/KDEs and perform marginal KL/bayesian dimensionality calculations.
MIT License
13 stars 8 forks source link

Tidying now unnecessary edge correction code #7

Closed williamjameshandley closed 2 years ago

williamjameshandley commented 2 years ago

Description

This PR:

a) removes the 0.001 and 0.999 edge corrections in margarine/processing.py b) turns the explicit transformations into quantiles in margarine/processing.py c) removes the 0.001 and 0.999 edge corrections in margarine/maf.py d) tidys margarine/maf.py in light of these changes, as well as a more numpythonic return calculation from logprob

This possible now that the correction factors have been implemented, and we no longer need to guard against the then erroneous nans.

Tests pass locally on my machine.

htjb commented 2 years ago

Thanks Will! This is helpful.

Could you please remove the edge correction in margarine/kde.py as well in this PR? Assuming that passes the tests then we can go ahead and merge it.