mackelab / delfi

Density estimation likelihood-free inference. No longer actively developed see https://github.com/mackelab/sbi instead
http://www.mackelab.org/delfi
Other
71 stars 28 forks source link

Transformations #50

Closed dgreenberg closed 5 years ago

dgreenberg commented 5 years ago

Added new classes to support parameter space transformations for distributions and simulators.

Added new tests.

Make sure mean/std are not None when using prior_norm.

dgreenberg commented 5 years ago

Cool!

One suggestion: how about setting the logistic transformation as default for the bijection? Would probably make it more straightforward to use, and it is already implemented in test_distribution.py anyway.

I think that's a good idea and we should move that direction. For now I wanted to keep things explicit though.

What I'm picturing in the future is a utility function where you pass in the prior and the simulator, and depending on whether each dimension of the prior is bounded above, below, or both, it does the necessary transformation of both. Once that's working, we can add a flag to the inference methods to do this automatically, and then reverse-transform the posterior afterwards.

jan-matthis commented 5 years ago

Looks good to me! Do you want to make the utility function that handles the bounds part of this PR or keep it separate?

dgreenberg commented 5 years ago

Looks good to me! Do you want to make the utility function that handles the bounds part of this PR or keep it separate?

I was planning to directly focus on the l5pc now, so if everything looks good I'll merge and the automatic stuff can come later, unless someone else wants to do it now.

ppjgoncalves commented 5 years ago

Looks good to me as well (although my approval comes late).