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

Flow weighting in clusterMAF #39

Closed ThomasGesseyJones closed 10 months ago

ThomasGesseyJones commented 10 months ago

As outlined in more detail in issue #38 the flows in clusterMAF were incorrectly weighted in __call__ and not weighted in log_prob. These led to incorrect sampling distributions and erroneous $D_{\rm KL}$ values respectively. This PR fixes #38 by now weighting the flows in both of these contexts in proportion to the sample weights in the corresponding clusters.

Additional minor changes:

htjb commented 10 months ago

Looks great! Thanks @ThomasGesseyJones! If the tests pass, please squash and merge.