-
Notifications
You must be signed in to change notification settings - Fork 36
Description
Summary
Once DynamicPPL 0.37 is released, these three will be the only parent contexts left. @yebai and I think these could be 'removed' or to be precise, inserted as extra fields on the DynamicPPL.Model object rather than being part of the context stack in model.context.
This essentially amounts to some shuffling of information around so from a data structure point of view this is a sideways change, but the key benefit is that we can dispense with parent contexts entirely.
Note that these three contexts also correspond naturally to the functions condition, fix, and prefix which act on models, so in some ways it is also more natural / direct for condition(model, ...) to modify e.g. a model.conditioned field rather than to attach a ConditionContext to the model's context.
Finally, it would be nice to have a unified data structure for condition and fix. The only difference is whether logp is accumulated so this feels like an opportunity to reduce code duplication.
Progress
- Investigate feasibility
- Part 1: Replace
PrefixContextwithmodel.prefix#1011 - Part 2: Unifying ConditionContext and FixedContext
- Part 3: Converting CondFixedContext to a model field
- Part 4: Update documentation