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

Support for multiple dependency/parent nodes in AutoStructured [feature request] #2950

Closed
vitkl opened this issue Oct 26, 2021 · 2 comments
Closed
Assignees

Comments

@vitkl
Copy link
Contributor

vitkl commented Oct 26, 2021

Often in hierarchical models, the prior value of a site depends on the value of several parent nodes via a specific computation (such as matrix multiplication).

For example in this case, the value of w_sf depend on k_sr and q_rf:

d_sg ~ Poisson(mu_sg)
mu_sg = sum_f w_sf * g_fg
w_sf ~ Gamma(10, 10 / mu_sf)
mu_sf = sum_r k_sr * q_rf
k_sr ~ Gamma(1, 1)
q_rf ~ Gamma(1, 1)

Would be great if it was possible to not only say that w_sf depend on k_sr and q_rf but specify a function that gives a hierarchical component of w_sf:

AutoStructured(dependencies={'w_sf': {['k_sr', 'q_rf']: lambda k_sr, q_rf: k_sr @ q_rf})

This probably also needs the site to be available in a non-flattened format.

@fritzo fritzo self-assigned this Oct 26, 2021
@fritzo
Copy link
Member

fritzo commented Oct 26, 2021

Sounds like a good idea, and I think this should be mostly easy. The one trick will be backwards compatibility with unflattened inputs and outputs 🤔

@fritzo
Copy link
Member

fritzo commented Nov 7, 2021

Resolved by #2953, #2955

@fritzo fritzo closed this as completed Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants