v0.34.2
DynamicPPL v0.34.2
- Fixed bugs in ValuesAsInModelContext as well as DebugContext where underlying PrefixContexts were not being applied. From a user-facing perspective, this means that for models which use manually prefixed submodels, e.g.
using DynamicPPL, Distributions
@model inner() = x ~ Normal()
@model function outer()
x1 ~ to_submodel(prefix(inner(), :a), false)
x2 ~ to_submodel(prefix(inner(), :b), false)
endwill: (1) no longer error when sampling due to check_model_and_trace; and (2) contain both submodel's variables in the resulting chain (the behaviour before this patch was that the second x would override the first x).
- More broadly, implemented a general
prefix(ctx::AbstractContext, ::VarName)which traverses the context tree inctxto apply all necessary prefixes. This was a necessary step in fixing the above issues, but it also means thatprefixis now capable of handling context trees with e.g. multiple prefixes at different levels of nesting.
Merged pull requests:
- Expand JET test (#782) (@penelopeysm)
- Clarify is_unconstrained docstring (#790) (@penelopeysm)