-
Notifications
You must be signed in to change notification settings - Fork 162
Issue 561: Rename variables to reflect that they are choice maps #562
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
Conversation
|
Thanks for this! Everything seems to pass, but could we change Your understanding of the static IR is correct! |
Thats a good point, I'll make a quick change. |
|
Having another look at the code base I found Gen.jl/src/dynamic/backprop.jl Lines 349 to 350 in 8f2f4cc
this has the other way of representing the variables e.g. |
|
Yes, feel free to change that as well! |
|
Now that I've merged #559 into the main branch, it'd be great if you could resolve the merge conflicts with that as well. |
Refactored code and tests to consistently use 'choice_value' and 'choice_gradient' instead of 'value_trie' and 'gradient_trie' for clarity and alignment with choicemap terminology. Updated variable names, function signatures, and related comments across inference, static IR, and test files.
65d8726 to
c39c74d
Compare
Renamed 'values_trie' and 'gradient_trie' to 'value_choices' and 'gradient_choices' in HMC and MAP optimization code, as well as corresponding test cases, to improve code readability and clarity.
|
I've gone for I've also changed this for the MAP opt and mala but I've let the unit tests be lax on these changes. |
ztangent
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good but let's update the docstring and the static IR code as well.
|
It was a bit fiddly because you don't want to collide with the |
ztangent
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thank you!
This PR closes #561 .
This PR renames instances where a variable is a
ChoiceMapto usechoice_prefix consistently, i.e. use 'choice_value' and 'choice_gradient' instead of 'value_trie' and 'gradient_trie' for clarity and alignment with choicemap terminology. I've left variables that are typed to beTries.Main danger is that my understanding of the static IR for Gen is that the
gensyms for e.g value_trie are also meant to reflect creating a local variable name for a choice map object. If this is incorrect then I should revert those changes.