Skip to content

Conversation

@fehiepsi
Copy link
Member

This PR enables running SVI with guides which propose multiple samples.

:param vectorize_particles: Whether to use `jax.vmap` to compute ELBOs over the
num_particles-many particles in parallel. If False use `jax.lax.map`.
Defaults to True.
:param multi_sample_guide: Whether to make an assumption that the guide proposes
Copy link
Collaborator

Choose a reason for hiding this comment

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

why not infer this from isinstance(guide, ...)? do we expect guides with this attribute apart from a small number of AutoGuides we construct?

Copy link
Member Author

Choose a reason for hiding this comment

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

please feel free to remove this when such auto guides are available.

model_log_density, model_trace = log_density(
replay_model, args, kwargs, params
)
check_model_guide_match(model_trace, guide_trace)
Copy link
Collaborator

Choose a reason for hiding this comment

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

so we lose these two checks if multi_sample_guide==True?

Copy link
Member Author

Choose a reason for hiding this comment

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

we can check the later one. The first one is tricky.

@martinjankowiak martinjankowiak merged commit d9b52d7 into pyro-ppl:master Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants