Skip to content

Support marginalising through a MinibatchRandomVariable #498

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

Merged
merged 2 commits into from
Jun 9, 2025

Conversation

zaxtax
Copy link
Contributor

@zaxtax zaxtax commented Jun 8, 2025

This adds support in the graph analysis for MinibatchRandomVariable

Closes #492

@zaxtax zaxtax requested a review from ricardoV94 June 8, 2025 00:54
@@ -140,6 +141,9 @@ def _subgraph_batch_dim_connection(var_dims: VAR_DIMS, input_vars, output_vars)
elif isinstance(node.op, ModelVar):
var_dims[node.outputs[0]] = inputs_dims[0]

elif isinstance(node.op, MinibatchRandomVariable):
Copy link
Member

Choose a reason for hiding this comment

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

Nit I kind of tried to order the if elif branches by likelihood, in which case I would put this last

@zaxtax zaxtax requested a review from ricardoV94 June 9, 2025 14:20
Copy link
Member

@jessegrabowski jessegrabowski left a comment

Choose a reason for hiding this comment

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

lgtm

@ricardoV94 ricardoV94 merged commit 009b5ac into pymc-devs:main Jun 9, 2025
17 checks passed
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.

Model marginalization doesn't work through Minibatch nodes
3 participants