-
Notifications
You must be signed in to change notification settings - Fork 161
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
Combine regenerate
and update
into an update method taking an UpdateSpec object
#282
base: master
Are you sure you want to change the base?
Combine regenerate
and update
into an update method taking an UpdateSpec object
#282
Conversation
…eorgematheos-distributionsasgenfns
Made a couple performance improvements. Here is some benchmarking. Looks like the static DSL is a bit faster than on the master branch, and the dynamic DSL is slower (by a more significant amount). Asymptotic performance does not seem to be majorly affected in these simple tests. The performance slowdown for the dynamic DSL appears to have been introduced by my initial PR which introduces the concept of a "Value Choice Map"; the performance on dynamic DSL inference did not degrade (and if anything, it slightly improved) when I made distributions generative functions, implemented addresstrees, and changed the Benchmarks: This PR:
Master branch:
|
…00706-georgematheos-updatespec
…ree{Union{val, sel}})
As a TODO--I realize the current implementation here of distributions as generative functions is incompatible with the distribution DSL since it assumes distributions are fully defined by their type information. This should be a quick fix. |
This PR builds upon #279 to change the signature of
update
to the following:update_spec
is a specific type of AddressTree. It can select some addresses to regenerate using the internal proposal distribution and constrain some addresses to choices, or include address tree leafs of typeCustomUpdateSpec
which specify an update that a custom generative function knows how to perform. As I am currently conceiving it, custom update specs must be equivalent to a combination of selecting and constraining addresses--but at some point I think we could reformalize in such a way to relax this requirement, and use these custom update specs to effectively allow generative functions to implement multiple internal proposal distributions.externally_constrained_addresses
is a selection including all addresses which external proposal distributions will constrain the values for when applying the reverse move to this update. This selection will determine what weight the update function calculates: it will include the termQ[old_tr | get_selected(reverse_update_spec, externally_constrained_addrs)]
. To implement the oldupdate
weight, we setexternally_constrained_addrs = AllSelection()
; to implement the oldregenerate
weight, we setexternally_constrained_addrs = EmptySelection()
.I have implemented syntactic sugar so the old calls to
update
andregenerate
still work, by being translated into the correct call to the new update method.I have changed the dynamic DSL, static DSL, CallAt, Map, and Unfold combinators to use this new update method. I have not changed Recurse yet.
This is still a WIP and I need to document these changes and do some performance engineering. I am putting this online since others may need access to this branch to use some of my open universe inference tools.
notes:
Recurse
did not have an implementation for regenerate; I have not implemented the fully generalupdate
function yetTODOS:
metropolis_hastings
which allows for simultaneous selection and constraintsResolves #266 , resolves #279 , resolves #259, resolves #258 , resolves #189, resolves #274, resolves #263