Skip to content

Commit 899ef8f

Browse files
authored
Merge branch 'main' into 238-enhance-workflow-clarity-of-the-project
2 parents bec6a9e + 0bd5a60 commit 899ef8f

File tree

7 files changed

+29
-27
lines changed

7 files changed

+29
-27
lines changed

Project.toml

Lines changed: 2 additions & 2 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 = "2.16.2"
4+
version = "2.17.0"
55

66
[deps]
77
BayesBase = "b4ee3484-f114-42fe-b91c-797d54a0c67e"
@@ -34,7 +34,7 @@ MacroTools = "0.5.6"
3434
Optim = "1.0.0"
3535
ProgressMeter = "1.0.0"
3636
Random = "1.9"
37-
ReactiveMP = "~3.13.0"
37+
ReactiveMP = "~3.14.0"
3838
Reexport = "1.2.0"
3939
Rocket = "1.7.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": "2.16.2",
12+
"version": "2.17.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": "2.16.2",
17+
"softwareVersion": "2.17.0",
1818
"keywords": [
1919
"Bayesian inference",
2020
"message passing",

docs/src/manuals/inference/manual.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ m_n_updates = getmarginals(m_n)
8585

8686
## [Feeding observations](@id user-guide-manual-inference-observations)
8787

88-
By default (without any extra factorisation constraints) model specification implies Belief Propagation message passing update rules. In case of BP algorithm `RxInfer` package computes an exact Bayesian posteriors with a single message passing iteration. To enforce Belief Propagation message passing update rule for some specific factor node user may use `where { q = FullFactorisation() }` option. Read more in [Model Specification](@ref user-guide-model-specification) section. To perform a message passing iteration we need to pass some data to all our data inputs that were created with [`datavar` function](@ref user-guide-model-specification-data-variables) during model specification.
88+
By default (without any extra factorisation constraints) model specification implies Belief Propagation message passing update rules. In case of BP algorithm `RxInfer` package computes an exact Bayesian posteriors with a single message passing iteration. To enforce Belief Propagation message passing update rule for some specific factor node user may use `where { q = BetheFactorisation() }` option. Read more in [Model Specification](@ref user-guide-model-specification) section. To perform a message passing iteration we need to pass some data to all our data inputs that were created with [`datavar` function](@ref user-guide-model-specification-data-variables) during model specification.
8989

9090
To feed an observation for a specific data input we use `update!` function:
9191

docs/src/manuals/model-specification.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,22 +334,22 @@ where `RecognitionFactorisationConstraint` can be the following
334334

335335
1. `MeanField()`
336336

337-
Automatically specifies a mean-field factorisation
337+
Automatically specifies a naive mean-field factorisation
338338

339339
Example:
340340

341341
```julia
342342
y ~ NormalMeanVariance(y_mean, y_var) where { q = MeanField() }
343343
```
344344

345-
2. `FullFactorisation()`
345+
2. `BetheFactorisation()`
346346

347-
Automatically specifies a full factorisation
347+
Automatically specifies the Bethe factorisation. For more information on Bethe factorisation, please the section on [Bethe approximation](/docs/src/library/bethe-free-energy.md#bethe-approximationid-lib-bethe-approximation).
348348

349349
Example:
350350

351351
```julia
352-
y ~ NormalMeanVariance(y_mean, y_var) where { q = FullFactorisation() }
352+
y ~ NormalMeanVariance(y_mean, y_var) where { q = BetheFactorisation() }
353353
```
354354

355355
3. `q(μ)q(v)q(out)` or `q(μ) * q(v) * q(out)`

src/graphppl.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,9 @@ function write_fconstraint_option(form, variables, fconstraint)
222222
elseif @capture(fconstraint, MeanField())
223223
return :(ReactiveMP.MeanField())
224224
elseif @capture(fconstraint, FullFactorisation())
225-
return :(ReactiveMP.FullFactorisation())
225+
return :(ReactiveMP.BetheFactorisation())
226+
elseif @capture(fconstraint, BetheFactorisation())
227+
return :(ReactiveMP.BetheFactorisation())
226228
else
227229
error("Invalid factorisation constraint: $fconstraint")
228230
end

test/constraints/factorisation_constraints_tests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -465,7 +465,7 @@
465465
# But it would be nice to support this case too
466466
@test_throws ErrorException ReactiveMP.resolve_factorisation(cs, getvariables(model), TestFactorisationStochastic, (d, z))
467467
# Deterministic node should ignore `resolve_factorisation` and multiple proxy vars
468-
@test ReactiveMP.resolve_factorisation(cs, getvariables(model), TestFactorisationDeterministic, (d, z)) == FullFactorisation()
468+
@test ReactiveMP.resolve_factorisation(cs, getvariables(model), TestFactorisationDeterministic, (d, z)) == BetheFactorisation()
469469
end
470470

471471
## Warning testing below

test/node_tests.jl

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@
6868
@testset "Default functional dependencies" begin
6969
import ReactiveMP: DefaultFunctionalDependencies
7070

71-
@testset "Default functional dependencies: FullFactorisation" begin
72-
# We test `FullFactorisation` case here
73-
m, x, y, z, node = make_dummy_model(FullFactorisation(), DefaultFunctionalDependencies())
71+
@testset "Default functional dependencies: BetheFactorisation" begin
72+
# We test `BetheFactorisation` case here
73+
m, x, y, z, node = make_dummy_model(BetheFactorisation(), DefaultFunctionalDependencies())
7474

7575
# Test that pipeline dependencies have been set properly
7676
@test ReactiveMP.get_pipeline_dependencies(ReactiveMP.getpipeline(node)) === DefaultFunctionalDependencies()
@@ -187,12 +187,12 @@
187187
@testset "Require inbound message functional dependencies" begin
188188
import ReactiveMP: RequireMessageFunctionalDependencies
189189

190-
@testset "Require inbound message functional dependencies: FullFactorisation" begin
190+
@testset "Require inbound message functional dependencies: BetheFactorisation" begin
191191
# Require inbound message on `x`
192192
pipeline = RequireMessageFunctionalDependencies((1,), (NormalMeanVariance(0.123, 0.123),))
193193

194-
# We test `FullFactorisation` case here
195-
m, x, y, z, node = make_dummy_model(FullFactorisation(), pipeline)
194+
# We test `BetheFactorisation` case here
195+
m, x, y, z, node = make_dummy_model(BetheFactorisation(), pipeline)
196196

197197
# Test that pipeline dependencies have been set properly
198198
@test ReactiveMP.get_pipeline_dependencies(ReactiveMP.getpipeline(node)) === pipeline
@@ -218,8 +218,8 @@
218218
# Require inbound message on `y` and `z`
219219
pipeline = RequireMessageFunctionalDependencies((2, 3), (NormalMeanVariance(0.123, 0.123), nothing))
220220

221-
# We test `FullFactorisation` case here
222-
m, x, y, z, node = make_dummy_model(FullFactorisation(), pipeline)
221+
# We test `BetheFactorisation` case here
222+
m, x, y, z, node = make_dummy_model(BetheFactorisation(), pipeline)
223223

224224
# Test that pipeline dependencies have been set properly
225225
@test ReactiveMP.get_pipeline_dependencies(ReactiveMP.getpipeline(node)) === pipeline
@@ -385,12 +385,12 @@
385385
@testset "Require marginal functional dependencies" begin
386386
import ReactiveMP: RequireMarginalFunctionalDependencies
387387

388-
@testset "Require marginal functional dependencies: FullFactorisation" begin
388+
@testset "Require marginal functional dependencies: BetheFactorisation" begin
389389
# Require marginal on `x`
390390
pipeline = RequireMarginalFunctionalDependencies((1,), (NormalMeanVariance(0.123, 0.123),))
391391

392-
# We test `FullFactorisation` case here
393-
m, x, y, z, node = make_dummy_model(FullFactorisation(), pipeline)
392+
# We test `BetheFactorisation` case here
393+
m, x, y, z, node = make_dummy_model(BetheFactorisation(), pipeline)
394394

395395
# Test that pipeline dependencies have been set properly
396396
@test ReactiveMP.get_pipeline_dependencies(ReactiveMP.getpipeline(node)) === pipeline
@@ -416,8 +416,8 @@
416416
# Require marginals on `y` and `z`
417417
pipeline = RequireMarginalFunctionalDependencies((2, 3), (NormalMeanVariance(0.123, 0.123), nothing))
418418

419-
# We test `FullFactorisation` case here
420-
m, x, y, z, node = make_dummy_model(FullFactorisation(), pipeline)
419+
# We test `BetheFactorisation` case here
420+
m, x, y, z, node = make_dummy_model(BetheFactorisation(), pipeline)
421421

422422
# Test that pipeline dependencies have been set properly
423423
@test ReactiveMP.get_pipeline_dependencies(ReactiveMP.getpipeline(node)) === pipeline
@@ -583,11 +583,11 @@
583583
@testset "Require everything functional dependencies" begin
584584
import ReactiveMP: RequireEverythingFunctionalDependencies
585585

586-
@testset "Require everything functional dependencies: FullFactorisation" begin
586+
@testset "Require everything functional dependencies: BetheFactorisation" begin
587587
pipeline = RequireEverythingFunctionalDependencies()
588588

589-
# We test `FullFactorisation` case here
590-
m, x, y, z, node = make_dummy_model(FullFactorisation(), pipeline)
589+
# We test `BetheFactorisation` case here
590+
m, x, y, z, node = make_dummy_model(BetheFactorisation(), pipeline)
591591

592592
# Test that pipeline dependencies have been set properly
593593
@test ReactiveMP.get_pipeline_dependencies(ReactiveMP.getpipeline(node)) === pipeline

0 commit comments

Comments
 (0)