From ed1fe1733bed2ca350117968f910e4766321f882 Mon Sep 17 00:00:00 2001 From: Johannes Terblanche <6612981+Affie@users.noreply.github.com> Date: Mon, 29 Aug 2022 20:25:29 +0200 Subject: [PATCH 1/2] Test and Fix Point2Point2Range as in RoME (#1617) --- src/services/EvalFactor.jl | 4 ++-- test/testEuclidDistance.jl | 27 +++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/services/EvalFactor.jl b/src/services/EvalFactor.jl index 3bdeb2f0a..f99621438 100644 --- a/src/services/EvalFactor.jl +++ b/src/services/EvalFactor.jl @@ -182,13 +182,13 @@ function computeAcrossHypothesis!(ccwl::Union{<:CommonConvWrapper{F}, for i in 1:Threads.nthreads() ccwl.cpt[i].activehypo = vars; end addEntr = view(ccwl.params[sfidx], allelements[count]) - # dynamic estimate with user requested speadNH of how much noise to inject (inflation or nullhypo) - spreadDist = calcVariableDistanceExpectedFractional(ccwl, sfidx, certainidx, kappa=ccwl.inflation) # do proposal inflation step, see #1051 # consider duplicate convolution approximations for inflation off-zero # ultimately set by dfg.params.inflateCycles for iflc in 1:inflateCycles + # dynamic estimate with user requested speadNH of how much noise to inject (inflation or nullhypo) + spreadDist = calcVariableDistanceExpectedFractional(ccwl, sfidx, certainidx, kappa=ccwl.inflation) addEntropyOnManifold!(mani, addEntr, 1:getDimension(mani), spreadDist, ccwl.partialDims) # no calculate new proposal belief on kernels `allelements[count]` _checkErrorCCWNumerics(ccwl, testshuffle) diff --git a/test/testEuclidDistance.jl b/test/testEuclidDistance.jl index 174c1f3ea..e1ec02776 100644 --- a/test/testEuclidDistance.jl +++ b/test/testEuclidDistance.jl @@ -136,6 +136,33 @@ end # at least one of the 3 solves should produce the right result +## +#test one clique as in RoME +N=100 +points = [[100.0;0.0],[0.0;100.0]] +fg = IIF.generateGraph_EuclidDistance(points) +fg.solverParams.graphinit = false + +M = getManifold(fg, :l1) +TP = false +for i in 1:3 + # global TP, N + tree = solveTree!(fg); + + L1 = getBelief(fg, :l1) |> getPoints + + # check that two modes exist + am1 = sum(isapprox.(Ref(M), L1, Ref([0.0,0.0]), atol=10)) + am2 = sum(isapprox.(Ref(M), L1, Ref([100.0,100.0]), atol=10)) + + TP = am1 > N*0.03 + TP &= am2 > N*0.03 + if TP + @info "test passed in $i" + break + end +end +@test TP ## end From 633fc391c2bf885ef01a9d901174bf57f70c1313 Mon Sep 17 00:00:00 2001 From: Johannes Terblanche Date: Mon, 29 Aug 2022 20:31:23 +0200 Subject: [PATCH 2/2] bump to v0.30.7 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 592c1a184..c9c7ffbcd 100644 --- a/Project.toml +++ b/Project.toml @@ -2,7 +2,7 @@ name = "IncrementalInference" uuid = "904591bb-b899-562f-9e6f-b8df64c7d480" keywords = ["MM-iSAMv2", "Bayes tree", "junction tree", "Bayes network", "variable elimination", "graphical models", "SLAM", "inference", "sum-product", "belief-propagation"] desc = "Implements the Multimodal-iSAMv2 algorithm." -version = "0.30.6" +version = "0.30.7" [deps] ApproxManifoldProducts = "9bbbb610-88a1-53cd-9763-118ce10c1f89"