Skip to content

mirror wgf for constrained params - #16

Open
eclipse1605 wants to merge 12 commits into
pymc-devs:mainfrom
eclipse1605:constrained-params
Open

mirror wgf for constrained params#16
eclipse1605 wants to merge 12 commits into
pymc-devs:mainfrom
eclipse1605:constrained-params

Conversation

@eclipse1605

Copy link
Copy Markdown
Collaborator
  • particles stay in dual value_vars; particle drift uses primal ∇; noise σ = exp(-½ log_jac_det); ArviZ posterior packed via backward
  • dual vs primal grad split: point APIs stay ∇_y; flat/batched/drift apply primal scaling

closes #6

@review-notebook-app

Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Comment thread examples/mirror_variance_mixture.ipynb
@@ -0,0 +1,391 @@
{

@yannmclatchie yannmclatchie Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested rewording: "The likelihood is still misspecified: a single Gaussian cannot match $P_0$, but a scale mixture of Gaussians can."


Reply via ReviewNB

@@ -0,0 +1,391 @@
{

@yannmclatchie yannmclatchie Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just add one sentence here to the effect of "constrained parameters are automatically detected and the flow uses a mirror-mapped geometry based on the default PyMC [transformations](https://www.pymc.io/projects/docs/en/stable/api/distributions/transforms.html)."


Reply via ReviewNB

@@ -0,0 +1,391 @@
{

@yannmclatchie yannmclatchie Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we can write here how we will investigate whether the traces respected their constraints throughout the course of the flow. (which I think you have previously written in the cells above)


Reply via ReviewNB

@@ -0,0 +1,391 @@
{

@yannmclatchie yannmclatchie Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And here we can write how by identifying a bimodal mixture over the scales the induced predictive distribution also more closely resembles the observed data distribution. If you wanted to take this farther, you could even fit the same model with a Bayes posterior and plot their respective posterior predictive checks: the Bayes posterior will have poor predictive calibration/coverage. (This is not strictly necessary for the purposes of getting the package up and running, but potentially interesting for people who are less familiar with predictively oriented posteriors)


Reply via ReviewNB

Comment thread pymc_prop/arviz.py
Comment thread pymc_prop/arviz.py Outdated
Comment thread pymc_prop/compile.py Outdated
Comment thread pymc_prop/compile.py Outdated
Comment thread pymc_prop/compile.py
Comment thread pymc_prop/compile.py
Comment thread pymc_prop/particles.py Outdated
Comment thread pymc_prop/points.py
Comment thread pymc_prop/points.py Outdated
Comment thread pymc_prop/sample.py Outdated
@@ -0,0 +1,389 @@
{

@yannmclatchie yannmclatchie Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably no need for this cell or the one titled Scale trajectories, we can just write a single code comment at the top of the cell like # plot particle trajectories and # plot posterior histogram : the point of this notebook isn't to discuss inference output shapes but rather the mirror mapped behaviour (you can maybe add a cell after the trajectories which points out that the particles remain positive; in fact you could even show the y-axis in sqrt or log scale to make this clearer, but I don't know if it's super helpful)


Reply via ReviewNB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wasserstein gradient flows with constrained model parameters

2 participants