Skip to content

Commit

Permalink
update ReactiveMP.jl version, bump version to 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bvdmitri committed Feb 6, 2023
1 parent 0828146 commit 538f335
Show file tree
Hide file tree
Showing 5 changed files with 174 additions and 2,620 deletions.
4 changes: 2 additions & 2 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 = "2.6.0"
version = "2.7.0"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand All @@ -26,7 +26,7 @@ GraphPPL = "3.1.0"
MacroTools = "0.5.6"
Optim = "1.0.0"
ProgressMeter = "1.0.0"
ReactiveMP = "~3.4.0"
ReactiveMP = "~3.5.0"
Reexport = "1.2.0"
Rocket = "1.6.0"
TupleTools = "1.2.0"
Expand Down
2 changes: 2 additions & 0 deletions examples/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
ReactiveMP = "a194aa59-28ba-4574-a09c-4a745416d6e3"
ReverseDiff = "37e2e3b7-166d-5795-8a7a-e32c996b4267"
Rocket = "df971d30-c9d6-4b37-b8ff-e965b2cb3a40"
RxInfer = "86711068-29c9-4ff7-b620-ae75d7495b3d"
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b"
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
Expand Down
2,770 changes: 161 additions & 2,609 deletions examples/Universal Mixtures.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions test/models/mixtures/test_gmm_univariate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ end
@test length(mw1) === 10
@test length(mw2) === 10
@test length(fe) === 10 && all(filter(e -> abs(e) > 1e-3, diff(fe)) .< 0)
@test abs(last(fe) - 280.3276104) < 0.01
@test abs(last(fe) - 139.74362) < 0.01

ms = mean(last(mswitch))

Expand All @@ -100,14 +100,14 @@ end
rms = sort([μ1, μ2])

foreach(zip(rms, ems)) do (r, e)
@test abs(r - mean(e)) < 0.2
@test abs(r - mean(e)) < 0.19
end

ews = sort([last(mw1), last(mw2)], by = mean)
rws = sort([w, w])

foreach(zip(rws, ews)) do (r, e)
@test abs(r - mean(e)) < 0.2
@test abs(r - mean(e)) < 0.15
end

@test_plot "models" "gmm_univariate" begin
Expand Down
12 changes: 6 additions & 6 deletions test/models/mixtures/test_switch.jl
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ end
@test getdata(result2.posteriors[]) == getdata(resultswitch.posteriors[:in2])
@test getdata(resultswitch.posteriors[:in1]) == getdata(resultswitch.posteriors[]).components[1]
@test getdata(resultswitch.posteriors[:in2]) == getdata(resultswitch.posteriors[]).components[2]
@test getdata(resultswitch.posteriors[:selector]).p getdata(resultswitch.posteriors[]).prior.p[1]
@test getdata(resultswitch.posteriors[:selector]).p getdata(resultswitch.posteriors[]).weights

# check free energies
@test -result1.free_energy[1] getlogscale(result1.posteriors[])
@test -result2.free_energy[1] getlogscale(result2.posteriors[])
@test getlogscale(resultswitch.posteriors[:in1]) log(0.7) - result1.free_energy[1]
@test getlogscale(resultswitch.posteriors[:in2]) log(0.3) - result2.free_energy[1]
@test log(0.7 * exp(-result1.free_energy[1]) + 0.3 * exp(-result2.free_energy[1])) getlogscale(resultswitch.posteriors[:selector])
@test log(0.7 * exp(-result1.free_energy[1]) + 0.3 * exp(-result2.free_energy[1])) getlogscale(resultswitch.posteriors[])
@test getlogscale(resultswitch.posteriors[:in1]) log(0.3) - result1.free_energy[1]
@test getlogscale(resultswitch.posteriors[:in2]) log(0.7) - result2.free_energy[1]
@test log(0.3 * exp(-result1.free_energy[1]) + 0.7 * exp(-result2.free_energy[1])) getlogscale(resultswitch.posteriors[:selector])
@test log(0.3 * exp(-result1.free_energy[1]) + 0.7 * exp(-result2.free_energy[1])) getlogscale(resultswitch.posteriors[])
@test getlogscale(resultswitch.posteriors[]) getlogscale(resultswitch.posteriors[:selector])

## Create output plots
Expand All @@ -103,7 +103,7 @@ end
θestimated = resultswitch.posteriors[]
p = plot(title = "Inference results")

plot!(rθ, (x) -> pdf(MixtureModel([Beta(4.0, 8.0), Beta(8.0, 4.0)], Categorical([0.5, 0.5])), x), fillalpha = 0.3, fillrange = 0, label = "P(θ)", c = 1)
plot!(rθ, (x) -> pdf(MixtureDistribution([Beta(4.0, 8.0), Beta(8.0, 4.0)], [0.5, 0.5]), x), fillalpha = 0.3, fillrange = 0, label = "P(θ)", c = 1)
plot!(rθ, (x) -> pdf(getdata(θestimated), x), fillalpha = 0.3, fillrange = 0, label = "P(θ|y)", c = 3)
vline!([θ_real], label = "Real θ")
return p
Expand Down

2 comments on commit 538f335

@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/77108

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 v2.7.0 -m "<description of version>" 538f335c6744cb4701b481ec1fb85ff4216fa910
git push origin v2.7.0

Please sign in to comment.