Skip to content

Commit b73103c

Browse files
committed
fixes for new versions of GraphPPL and ReactiveMP
1 parent 024d426 commit b73103c

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "RxInfer"
22
uuid = "86711068-29c9-4ff7-b620-ae75d7495b3d"
33
authors = ["Bagaev Dmitry <d.v.bagaev@tue.nl> and contributors"]
4-
version = "3.3.1"
4+
version = "3.4.0"
55

66
[deps]
77
BayesBase = "b4ee3484-f114-42fe-b91c-797d54a0c67e"
@@ -28,13 +28,13 @@ Distributions = "0.25"
2828
DomainSets = "0.5.2, 0.6, 0.7"
2929
ExponentialFamily = "1.2"
3030
FastCholesky = "1.3.0"
31-
GraphPPL = "~4.2.0"
31+
GraphPPL = "~4.3.0"
3232
LinearAlgebra = "1.9"
3333
MacroTools = "0.5.6"
3434
Optim = "1.0.0"
3535
ProgressMeter = "1.0.0"
3636
Random = "1.9"
37-
ReactiveMP = "~4.1.0"
37+
ReactiveMP = "~4.2.0"
3838
Reexport = "1.2.0"
3939
Rocket = "1.8.0"
4040
TupleTools = "1.2.0"

codemeta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"downloadUrl": "https://github.com/reactivebayes/RxInfer.jl/releases",
1010
"issueTracker": "https://github.com/reactivebayes/RxInfer.jl/issues",
1111
"name": "RxInfer.jl",
12-
"version": "3.3.1",
12+
"version": "3.4.0",
1313
"description": "Julia package for automated, scalable and efficient Bayesian inference on factor graphs with reactive message passing. ",
1414
"applicationCategory": "Statistics",
1515
"developmentStatus": "active",
1616
"readme": "https://reactivebayes.github.io/RxInfer.jl/stable/",
17-
"softwareVersion": "3.3.1",
17+
"softwareVersion": "3.4.0",
1818
"keywords": [
1919
"Bayesian inference",
2020
"message passing",

src/model/plugins/reactivemp_inference.jl

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,12 @@ function activate_rmp_variable!(plugin::ReactiveMPInferencePlugin, model::Model,
159159
# By default it is `UnspecifiedFormConstraint` which means that the form of the resulting distribution is not specified in advance
160160
# and follows from the computation, but users may override it with other form constraints, e.g. `PointMassFormConstraint`, which
161161
# constraints the resulting distribution to be of a point mass form
162-
messages_form_constraint = getextra(nodedata, GraphPPL.VariationalConstraintsMessagesFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
163-
marginal_form_constraint = getextra(nodedata, GraphPPL.VariationalConstraintsMarginalFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
162+
messages_form_constraint = ReactiveMP.preprocess_form_constraints(
163+
plugin, model, getextra(nodedata, GraphPPL.VariationalConstraintsMessagesFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
164+
)
165+
marginal_form_constraint = ReactiveMP.preprocess_form_constraints(
166+
plugin, model, getextra(nodedata, GraphPPL.VariationalConstraintsMarginalFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
167+
)
164168
# Fetch "prod-constraint" for messages and marginals. The prod-constraint usually defines the constraints for a single product of messages
165169
# It can for example preserve a specific parametrization of distribution
166170
messages_prod_constraint = getextra(nodedata, :messages_prod_constraint, ReactiveMP.default_prod_constraint(messages_form_constraint))
@@ -301,3 +305,11 @@ ReactiveMP.setmarginals!(collection::AbstractArray{GraphVariableRef}, marginal)
301305

302306
ReactiveMP.setmessage!(ref::GraphVariableRef, marginal) = setmessage!(ref.variable, marginal)
303307
ReactiveMP.setmessages!(collection::AbstractArray{GraphVariableRef}, marginal) = ReactiveMP.setmessages!(map(ref -> ref.variable, collection), marginal)
308+
309+
# Form constraint preprocessing
310+
311+
function ReactiveMP.preprocess_form_constraints(backend::ReactiveMPInferencePlugin, model::Model, constraints)
312+
# It is a simple pass-through for now, but can be extended in the future to preprocess constraints that
313+
# are defined in other packages, e.g. in `Distributions` and to support constraints, such as `q(x) :: Normal`
314+
return ReactiveMP.preprocess_form_constraints(constraints)
315+
end

0 commit comments

Comments
 (0)