Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check differential factors use correct approxDeconv result #1386

Closed
dehann opened this issue Sep 13, 2021 · 6 comments · Fixed by #1387
Closed

Check differential factors use correct approxDeconv result #1386

dehann opened this issue Sep 13, 2021 · 6 comments · Fixed by #1387

Comments

@dehann
Copy link
Member

dehann commented Sep 13, 2021

  • approxDeconv recently changed to return tangents, previously was coordinates.
  • differential factors based on MKD should be built with manifold points.

RoME test on IIF913 produced this error
(stable/good on left -- current master/bad on right):
Screenshot from 2021-09-12 16-32-02

@Affie
Copy link
Member

Affie commented Sep 13, 2021

It sounds like you are on the right track, I previously tracked the issue to approxDeconv and fixed it here #1380, but I didn't have time to dig deeper.

Just note that the sampleTangent function should be able to handle the correct sampling already. So if MKD is built correctly it should work.

@dehann
Copy link
Member Author

dehann commented Sep 13, 2021

I think the bug is happening here:

pts, = approxDeconv(tfg, afc.label, solveKey) # solveFactorMeasurements
# @show sft
newBel = manikde!(pts, sft)

@Affie
Copy link
Member

Affie commented Sep 13, 2021

Here is the test code I have so already, but it's focused on approxDeconv:

@testset "test deconv on <:AbstractManifoldMinimize" begin
##
fg = initfg()
getSolverParams(fg).useMsgLikelihoods = true
addVariable!(fg, :x0, SpecialEuclidean2)
addVariable!(fg, :x1, SpecialEuclidean2)
mp = ManifoldPrior(SpecialEuclidean(2), ProductRepr(@MVector([10.0,10.0]), @MMatrix([-1.0 0.0; 0.0 -1.0])), MvNormal([0.1, 0.1, 0.01]))
p = addFactor!(fg, [:x0], mp)
doautoinit!(fg,:x0)
addFactor!(fg, [:x0;:x1], ManifoldFactorSE2(MvNormal([10.0,0,0.1], diagm([0.5,0.5,0.05].^2))))
initAll!(fg)
# now check deconv
pred, meas = approxDeconv(fg, :x0x1f1)
@test mmd(SpecialEuclidean(2), pred, meas) < 1e-1
p_t = map(x->x.parts[1], pred)
m_t = map(x->x.parts[1], meas)
p_θ = map(x->x.parts[2][2], pred)
m_θ = map(x->x.parts[2][2], meas)
@test isapprox(mean(p_θ), 0.1, atol=0.02)
@test isapprox(std(p_θ), 0.05, atol=0.02)
@test isapprox(mean(p_t), [10,0], atol=0.2)
@test isapprox(std(p_t), [0.5,0.5], atol=0.2)
@test isapprox(mean(p_θ), mean(m_θ), atol=0.02)
@test isapprox(std(p_θ), std(m_θ), atol=0.02)
@test isapprox(mean(p_t), mean(m_t), atol=0.2)
@test isapprox(std(p_t), std(m_t), atol=0.2)
end

@Affie
Copy link
Member

Affie commented Sep 13, 2021

I think the bug is happening here

Yes, that needs to be converted to points. The current assumption is tangent on lie group so i think we can just use exp map at identity for now?

pred_X, _ = approxDeconv(tfg, afc.label, solveKey)
pts = exp(M, ident, pred_X)

@dehann
Copy link
Member Author

dehann commented Sep 13, 2021

Cool thanks, yes let me try that...

@dehann
Copy link
Member Author

dehann commented Sep 13, 2021

and getting the following error (stable/good on left -- current master/bad on right):
Screenshot from 2021-09-12 16-32-02

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants