MPoL-dev / MPoL

A flexible Python platform for Regularized Maximum Likelihood imaging
https://mpol-dev.github.io/MPoL/
MIT License
34 stars 11 forks source link

Bayesian Inference (posterior exploration) with MPoL and parametric models #33

Closed iancze closed 1 year ago

iancze commented 3 years ago

Is your feature request related to a problem or opportunity? Please describe. The MPoL framework allows the rapid calculation of gradients w.r.t. model parameters. If the sky-plane model is specified parametrically (i.e., as a sky-plane Gaussian, or Gaussian ring, etc...) and is reasonably low-dimensional (< 100) then the posterior distribution of those parameters can be explored using techniques like Variational Inference or Hamiltonian Monte Carlo, conveniently provided by the Pyro package.

This would make MPoL useable for more than just non-parametric imaging.

Describe the solution you'd like In theory, using Pyro with MPoL should already be possible (no modifications to MPoL needed).

We would like to test whether this is possible by making a tutorial showing how to

  1. Generate a fake dataset for testing (using existing baselines... + noise) and inspect with dirty image
  2. Write a parametric model as input to mpol.images.ImageCube
  3. Optimize the parametric model using Gradient Descent
  4. Explore the parameter posteriors using Pyro and HMC or VI sampling. We already did a little bit of this in PyMC3, but we'd like this to work with MPoL and Pyro.

We should start with a simple Gaussian blob model.

But for an application to real data, a useful (and popular) dataset would be the DSHARP AS 209 continuum. We could make a direct comparison to the posteriors calculated by Guzmán+18 using their ringed Gaussian model with 27 parameters, sampled by emcee.

iancze commented 1 year ago

Some updates on this issue.

iancze commented 1 year ago

Some updates on this issue:

Beyond the already-merged #121, most of the additional code for this is outside of any changes to the MPoL codebase itself. So I think this makes sense just to demonstrate these capabilities as a long-form tutorial.

To do that, I need to

Overview of tutorial contents

We made a movie showing iterative posterior predictions of the images but we found the actual changes were very small, and thus it didn't make for a great visualization.