|
8 | 8 |
|
9 | 9 | `VarInfo(vi::VarInfo, values)` has been removed. You can replace this directly with `unflatten(vi, values)` instead.
|
10 | 10 |
|
11 |
| -**The `VarInfo([rng, ]model[, sampler, context, metadata])` constructor has been replaced with the following methods:** |
| 11 | +The `metadata` argument to `VarInfo([rng, ]model[, sampler, context, metadata])` has been removed. |
| 12 | +If you were not using this argument (most likely), then there is no change needed. |
| 13 | +If you were using the `metadata` argument to specify a blank `VarNamedVector`, then you should replace calls to `VarInfo` with `DynamicPPL.typed_vector_varinfo` instead (see 'Other changes' below). |
12 | 14 |
|
13 |
| - 1. `UntypedVarInfo([rng, ]model[, sampler, context])` |
14 |
| - 2. `TypedVarInfo([rng, ]model[, sampler, context])` |
15 |
| - 3. `DynamicPPL.UntypedVectorVarInfo([rng, ]model[, sampler, context])` |
16 |
| - 4. `DynamicPPL.TypedVectorVarInfo([rng, ]model[, sampler, context])` |
| 15 | +The `UntypedVarInfo` constructor and type is no longer exported. |
| 16 | +If you needed to construct one, you should now use `DynamicPPL.untyped_varinfo` instead. |
17 | 17 |
|
18 |
| -**If you were not using the `metadata` argument (most likely), then you can directly replace calls to this constructor with `TypedVarInfo` instead.** |
19 |
| -That is to say, if you were using `VarInfo(model)`, you can replace this with `TypedVarInfo(model)`. |
| 18 | +The `TypedVarInfo` constructor and type is no longer exported. |
| 19 | +The _type_ has been replaced with `DynamicPPL.NTVarInfo`. |
| 20 | +The _constructor_ has been replaced with `DynamicPPL.typed_varinfo`. |
20 | 21 |
|
21 |
| -If you were using the `metadata` argument to specify a blank `VarNamedVector`, then you should replace calls to `VarInfo` with `TypedVectorVarInfo` instead. |
22 |
| -Note that the `VectorVarInfo` constructors (both `Untyped` and `Typed`) are not exported by default. |
23 |
| - |
24 |
| -If you were passing a non-empty metadata argument, you should use a different constructor of `VarInfo` instead. |
25 |
| - |
26 |
| -The reason for this change is that there were several flavours of VarInfo. |
27 |
| -Some, like TypedVarInfo, were easy to construct because we had convenience methods for them; however, the others were more difficult. |
28 |
| -This change makes it easier to access different VarInfo types, and also makes it more explicit which one you are constructing. |
29 |
| - |
30 |
| -The `untyped_varinfo` and `typed_varinfo` functions have also been removed; you can use `UntypedVarInfo` and `TypedVarInfo` as direct replacements. |
31 |
| - |
32 |
| -Finally, `TypedVarInfo` is no longer a type. |
33 |
| -It has been replaced with `NTVarInfo`. |
34 |
| -If you were dispatching on this, you should replace it with `NTVarInfo` instead. |
| 22 | +Note that the exact kind of VarInfo returned by `VarInfo(rng, model, ...)` is an implementation detail. |
| 23 | +Previously, it was guaranteed that this would always be a VarInfo whose metadata was a `NamedTuple` containing `Metadata` structs. |
| 24 | +Going forward, this is no longer the case, and you should only assume that the returned object obeys the `AbstractVarInfo` interface. |
35 | 25 |
|
36 | 26 | ### VarName prefixing behaviour
|
37 | 27 |
|
@@ -78,6 +68,20 @@ outer() | (a.x=1.0,)
|
78 | 68 | If you are sampling from a model with submodels, this doesn't affect the way you interact with the `MCMCChains.Chains` object, because VarNames are converted into Symbols when stored in the chain.
|
79 | 69 | (This behaviour will likely be changed in the future, in that Chains should be indexable by VarNames and not just Symbols, but that has not been implemented yet.)
|
80 | 70 |
|
| 71 | +**Other changes** |
| 72 | + |
| 73 | +While these are technically breaking, they are only internal changes and do not affect the public API. |
| 74 | +The following four functions have been added and/or reworked to make it easier to construct VarInfos with different types of metadata: |
| 75 | + |
| 76 | + 1. `DynamicPPL.untyped_varinfo([rng, ]model[, sampler, context])` |
| 77 | + 2. `DynamicPPL.typed_varinfo([rng, ]model[, sampler, context])` |
| 78 | + 3. `DynamicPPL.untyped_vector_varinfo([rng, ]model[, sampler, context])` |
| 79 | + 4. `DynamicPPL.typed_vector_varinfo([rng, ]model[, sampler, context])` |
| 80 | + |
| 81 | +The reason for this change is that there were several flavours of VarInfo. |
| 82 | +Some, like `typed_varinfo`, were easy to construct because we had convenience methods for them; however, the others were more difficult. |
| 83 | +This change makes it easier to access different VarInfo types, and also makes it more explicit which one you are constructing. |
| 84 | + |
81 | 85 | ## 0.35.5
|
82 | 86 |
|
83 | 87 | Several internal methods have been removed:
|
|
0 commit comments