Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Counterfactuals make inference customization difficult #81

Closed
eb8680 opened this issue Dec 28, 2022 · 2 comments
Closed

Counterfactuals make inference customization difficult #81

eb8680 opened this issue Dec 28, 2022 · 2 comments

Comments

@eb8680
Copy link
Contributor

eb8680 commented Dec 28, 2022

Models expanded by MultiWorldCounterfactual introduce plates automatically in a way that's hard to anticipate, and may mangle names of sample sites, e.g. by reusing obs_mask from pyro.sample to designate which copies of a particular variable are observed or unobserved (see #55 ). This makes it difficult to write custom guides or other custom inference components for estimating causal effects.

Most of the release examples (including the CEVAE #11) currently use autoguides or exact inference to get around this. Maybe that's just the recommendation we should be giving, including by using fancier autoguides like AutoStructured in more advanced examples? If so, we should discuss this explicitly somewhere in the documentation.

Alternatively, maybe there's a generic way to transform a guide that's correct for an unexpanded model into one that's correct for the expanded version, or documentation we could provide about customizing inference in this setting?

@SamWitty
Copy link
Collaborator

Alternatively, we could insist that any custom inference only operate on latents in the original (untransformed) model. This would impose some restrictions (e.g. we wouldn't be able to meaningfully condition on any random variables that are descendants of counterfactual outcomes, which could be useful for a Bayesian version of sensitivity analysis https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3800481/), but may be worth it.

To accomplish this we would want to;

  1. automatically mask any new latents generated from the counterfactual handlers to silence any "missing variables in the guide" warnings and ...
  2. leave names of factual variables unchanged

@robertness
Copy link
Collaborator

we wouldn't be able to meaningfully condition on any random variables that are descendants of counterfactual outcomes

This seems like it would be required to have multiworld counterfactuals as a valid use case

@BasisResearch BasisResearch locked and limited conversation to collaborators May 31, 2023
@eb8680 eb8680 converted this issue into discussion #127 May 31, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

3 participants