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

fix init_params bug in hmcgibbs #1673

Merged
merged 3 commits into from
Nov 10, 2023
Merged

fix init_params bug in hmcgibbs #1673

merged 3 commits into from
Nov 10, 2023

Conversation

amifalk
Copy link
Contributor

@amifalk amifalk commented Nov 9, 2023

Fixes bug described in #1672 - params updated via gibbs were not initialized when init_params was set

for name, site in self._prototype_trace.items():
if init_params and name in init_params:
gibbs_sites[name] = init_params[name]
init_params.pop(name)
Copy link
Member

Choose a reason for hiding this comment

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

I think you can combine those lines into ... = init_params.pop(name).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed!

@amifalk
Copy link
Contributor Author

amifalk commented Nov 10, 2023

While using the fix this morning, I realized the previous code did not account for init_params that are not gibbs sites, so I added an additional check.

@fehiepsi fehiepsi merged commit 24c21b8 into pyro-ppl:master Nov 10, 2023
4 checks passed
@fehiepsi
Copy link
Member

Thanks for the fix, @amifalk!

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.

None yet

2 participants