Skip to content

Commit

Permalink
Merge pull request #317 from ReactiveBayes/dev-update-3.4.0
Browse files Browse the repository at this point in the history
Fixes for new versions of GraphPPL and ReactiveMP
  • Loading branch information
bvdmitri authored Jun 17, 2024
2 parents 024d426 + b73103c commit 2dc0925
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
6 changes: 3 additions & 3 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "RxInfer"
uuid = "86711068-29c9-4ff7-b620-ae75d7495b3d"
authors = ["Bagaev Dmitry <d.v.bagaev@tue.nl> and contributors"]
version = "3.3.1"
version = "3.4.0"

[deps]
BayesBase = "b4ee3484-f114-42fe-b91c-797d54a0c67e"
Expand All @@ -28,13 +28,13 @@ Distributions = "0.25"
DomainSets = "0.5.2, 0.6, 0.7"
ExponentialFamily = "1.2"
FastCholesky = "1.3.0"
GraphPPL = "~4.2.0"
GraphPPL = "~4.3.0"
LinearAlgebra = "1.9"
MacroTools = "0.5.6"
Optim = "1.0.0"
ProgressMeter = "1.0.0"
Random = "1.9"
ReactiveMP = "~4.1.0"
ReactiveMP = "~4.2.0"
Reexport = "1.2.0"
Rocket = "1.8.0"
TupleTools = "1.2.0"
Expand Down
4 changes: 2 additions & 2 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
"downloadUrl": "https://github.com/reactivebayes/RxInfer.jl/releases",
"issueTracker": "https://github.com/reactivebayes/RxInfer.jl/issues",
"name": "RxInfer.jl",
"version": "3.3.1",
"version": "3.4.0",
"description": "Julia package for automated, scalable and efficient Bayesian inference on factor graphs with reactive message passing. ",
"applicationCategory": "Statistics",
"developmentStatus": "active",
"readme": "https://reactivebayes.github.io/RxInfer.jl/stable/",
"softwareVersion": "3.3.1",
"softwareVersion": "3.4.0",
"keywords": [
"Bayesian inference",
"message passing",
Expand Down
16 changes: 14 additions & 2 deletions src/model/plugins/reactivemp_inference.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,12 @@ function activate_rmp_variable!(plugin::ReactiveMPInferencePlugin, model::Model,
# By default it is `UnspecifiedFormConstraint` which means that the form of the resulting distribution is not specified in advance
# and follows from the computation, but users may override it with other form constraints, e.g. `PointMassFormConstraint`, which
# constraints the resulting distribution to be of a point mass form
messages_form_constraint = getextra(nodedata, GraphPPL.VariationalConstraintsMessagesFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
marginal_form_constraint = getextra(nodedata, GraphPPL.VariationalConstraintsMarginalFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
messages_form_constraint = ReactiveMP.preprocess_form_constraints(
plugin, model, getextra(nodedata, GraphPPL.VariationalConstraintsMessagesFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
)
marginal_form_constraint = ReactiveMP.preprocess_form_constraints(
plugin, model, getextra(nodedata, GraphPPL.VariationalConstraintsMarginalFormConstraintKey, ReactiveMP.UnspecifiedFormConstraint())
)
# Fetch "prod-constraint" for messages and marginals. The prod-constraint usually defines the constraints for a single product of messages
# It can for example preserve a specific parametrization of distribution
messages_prod_constraint = getextra(nodedata, :messages_prod_constraint, ReactiveMP.default_prod_constraint(messages_form_constraint))
Expand Down Expand Up @@ -301,3 +305,11 @@ ReactiveMP.setmarginals!(collection::AbstractArray{GraphVariableRef}, marginal)

ReactiveMP.setmessage!(ref::GraphVariableRef, marginal) = setmessage!(ref.variable, marginal)
ReactiveMP.setmessages!(collection::AbstractArray{GraphVariableRef}, marginal) = ReactiveMP.setmessages!(map(ref -> ref.variable, collection), marginal)

# Form constraint preprocessing

function ReactiveMP.preprocess_form_constraints(backend::ReactiveMPInferencePlugin, model::Model, constraints)
# It is a simple pass-through for now, but can be extended in the future to preprocess constraints that
# are defined in other packages, e.g. in `Distributions` and to support constraints, such as `q(x) :: Normal`
return ReactiveMP.preprocess_form_constraints(constraints)
end

2 comments on commit 2dc0925

@bvdmitri
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/109253

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v3.4.0 -m "<description of version>" 2dc09258b956f2811e0d4a2b9f400d85464833c2
git push origin v3.4.0

Please sign in to comment.