|
| 1 | +# DynamicPPL Changelog |
| 2 | + |
| 3 | +## 0.35.0 |
| 4 | + |
| 5 | +**Breaking** |
| 6 | + |
| 7 | +- For submodels constructed using `to_submodel`, the order in which nested prefixes are applied has been changed. |
| 8 | + Previously, the order was that outer prefixes were applied first, then inner ones. |
| 9 | + This version reverses that. |
| 10 | + To illustrate: |
| 11 | + |
| 12 | + ```julia |
| 13 | + using DynamicPPL, Distributions |
| 14 | + |
| 15 | + @model function subsubmodel() |
| 16 | + x ~ Normal() |
| 17 | + end |
| 18 | + |
| 19 | + @model function submodel() |
| 20 | + x ~ to_submodel(prefix(subsubmodel(), :c), false) |
| 21 | + return x |
| 22 | + end |
| 23 | + |
| 24 | + @model function parentmodel() |
| 25 | + x1 ~ to_submodel(prefix(submodel(), :a), false) |
| 26 | + x2 ~ to_submodel(prefix(submodel(), :b), false) |
| 27 | + end |
| 28 | + |
| 29 | + keys(VarInfo(parentmodel())) |
| 30 | + ``` |
| 31 | + |
| 32 | + Previously, the final line would return the variable names `c.a.x` and `c.b.x`. |
| 33 | + With this version, it will return `a.c.x` and `b.c.x`, which is more intuitive. |
| 34 | + (Note that this change brings `to_submodel`'s behaviour in line with the now-deprecated `@submodel` macro.) |
| 35 | + |
| 36 | + This change also affects sampling in Turing.jl. |
| 37 | + |
| 38 | + |
| 39 | +## 0.34.2 |
| 40 | + |
| 41 | +- Fixed bugs in ValuesAsInModelContext as well as DebugContext where underlying PrefixContexts were not being applied. |
| 42 | + From a user-facing perspective, this means that for models which use manually prefixed submodels, e.g. |
| 43 | + |
| 44 | + ```julia |
| 45 | + using DynamicPPL, Distributions |
| 46 | + |
| 47 | + @model inner() = x ~ Normal() |
| 48 | + |
| 49 | + @model function outer() |
| 50 | + x1 ~ to_submodel(prefix(inner(), :a), false) |
| 51 | + x2 ~ to_submodel(prefix(inner(), :b), false) |
| 52 | + end |
| 53 | + ``` |
| 54 | + |
| 55 | + will: (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`). |
| 56 | + |
| 57 | +- More broadly, implemented a general `prefix(ctx::AbstractContext, ::VarName)` which traverses the context tree in `ctx` to apply all necessary prefixes. This was a necessary step in fixing the above issues, but it also means that `prefix` is now capable of handling context trees with e.g. multiple prefixes at different levels of nesting. |
| 58 | + |
| 59 | +## 0.34.1 |
| 60 | + |
| 61 | +- Fix an issue that prevented merging two VarInfos if they had different dimensions for a variable. |
| 62 | + |
| 63 | +- Upper bound the compat version of KernelAbstractions to work around an issue in determining the right VarInfo type to use. |
| 64 | + |
| 65 | +## 0.34.0 |
| 66 | + |
| 67 | +**Breaking** |
| 68 | + |
| 69 | +- `rng` argument removed from `values_as_in_model`, and `varinfo` made non-optional. This means that the only signatures allowed are |
| 70 | + |
| 71 | + ``` |
| 72 | + values_as_in_model(::Model, ::Bool, ::AbstractVarInfo) |
| 73 | + values_as_in_model(::Model, ::Bool, ::AbstractVarInfo, ::AbstractContext) |
| 74 | + ``` |
| 75 | + |
| 76 | + If you aren't using this function (it's probably only used in Turing.jl) then this won't affect you. |
| 77 | + |
| 78 | +## 0.33.1 |
| 79 | + |
| 80 | +Reworked internals of `condition` and `decondition`. |
| 81 | +There are no changes to the public-facing API, but internally you can no longer use `condition` and `decondition` on an `AbstractContext`, you can only use it on a `DynamicPPL.Model`. If you want to modify a context, use `ConditionContext` and `decondition_context`. |
| 82 | + |
| 83 | +## 0.33.0 |
| 84 | + |
| 85 | +**Breaking** |
| 86 | + |
| 87 | +- `values_as_in_model()` now requires an extra boolean parameter, specifying whether variables on the lhs of `:=` statements are to be included in the resulting `OrderedDict` of values. |
| 88 | + The type signature is now `values_as_in_model([rng,] model, include_colon_eq::Bool [, varinfo, context])` |
| 89 | + |
| 90 | +**Other** |
| 91 | + |
| 92 | +- Moved the implementation of `predict` from Turing.jl to DynamicPPL.jl; the user-facing behaviour is otherwise the same |
| 93 | +- Improved error message when a user tries to initialise a model with parameters that don't correspond strictly to the underlying VarInfo used |
0 commit comments