Skip to content
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

Variationally Informed Parameterization: Recreate VIP class #367

Open
ferrine opened this issue Jul 24, 2024 · 1 comment
Open

Variationally Informed Parameterization: Recreate VIP class #367

ferrine opened this issue Jul 24, 2024 · 1 comment
Labels
enhancements New feature or request

Comments

@ferrine
Copy link
Member

ferrine commented Jul 24, 2024

https://github.com/pymc-devs/pymc-experimental/blob/d50742d4394fc764cfc0824821b63c235575917c/pymc_experimental/model/transforms/autoreparam.py#L422

So far the VIP transform creates an object with lambdas for manipulation at application time. If any model transform is done later (do, cond), the object is no longer relevant. The idea is to write a helper function as:

class VIP:
    @classmethod
    def from_model(cls, model, var_names: list[str]) -> VIP:
        # Collect lambdas based on name pattern "name" -> f"{name}::lam_logit__"
        ...
@ferrine ferrine added the enhancements New feature or request label Jul 24, 2024
@ricardoV94
Copy link
Member

ricardoV94 commented Dec 8, 2024

Perhaps lambas should be a subclass of shared variable that can be recognized by the type? More robust than by name.

The class could also be replaced by a purely functional approach?

Not sure if we're respecting the class of the shared variables when we convert to fgraph but should be easy to tweak. If not easy, a dummy op could be used to mark them but I don't think we need that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancements New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants