-
Notifications
You must be signed in to change notification settings - Fork 160
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
Make argdiff an optional keyword argument to update #229
Comments
I started implementing this here (including making the other arguments excluding the trace itself into keyword arguments): https://github.com/probcomp/Gen/tree/20200410-marcoct-argdiffoptional, but the extra typing for the keyword arguments almost makes the change not worth it. |
Actually, on second thought, we can keep the GFI interface signature the same (no keyword args), but then just the keyword argument wrapper for use by the inference library. function update(trace;
args=get_args(trace),
argdiffs=map((_) -> NoChange(), args),
constraints=EmptyChoiceMap())
update(trace, args, argdiffs, constraints)
end This is indeed what I implemented, so all the extra keyword arguments in calls were unnecessary. |
The same defaults for regenerate should be implemented as part of the same PR. |
It would default to the n-tuple of
NoChange()
values where n is the number of arguments to the generatiev function. Passing in the tuple ofNoChange()
values is common when doing operations on the top-level generative function of a model in e.g. MCMC.The text was updated successfully, but these errors were encountered: