Noise model Constrained::MixedSigma slows down optimization

76 views
Skip to first unread message

Philippe-Antoine Gohard

unread,
Sep 10, 2021, 11:42:29 AM9/10/21
to gtsam...@googlegroups.com
Hello everyone,

I am currently trying to calibrate the extrinsics parameters of a camera sensor using a projectionFactorPPP inside a big graph with other sensors. I recently tried to use the gtsam::noiseModel::Constrained::MixedSigmas in order to constrain the translation, by setting a priorFactor to the extrinsics using this MixedSigmas, and setting the sigma to 0 on the translation components. However, when I tried this, the optimization slowed down to more than a factor 10. 

Is this an expected behaviour (maybe because it creates an if statement deep in the code in the jacobian construction that prevents code optimization, or maybe because PPP factors are still unstable) or is this something else ? I didn't investigate a lot because setting low sigma for the translation gives good results for my problem, but I am wondering if there is something I don't get here and I'm curious what could be the reason.

Thanks in advance, and have a nice day everyone.

Best regards,

Philippe-Antoine

Dellaert, Frank

unread,
Sep 10, 2021, 2:21:28 PM9/10/21
to Philippe-Antoine Gohard, gtsam...@googlegroups.com
Calibration is connected to everything and creates a dense piece that needs to be factorized, so slow down is expected.

Best!
Frank

From: gtsam...@googlegroups.com <gtsam...@googlegroups.com> on behalf of Philippe-Antoine Gohard <philippe-an...@easymile.com>
Sent: Friday, September 10, 2021 11:42:16 AM
To: gtsam...@googlegroups.com <gtsam...@googlegroups.com>
Subject: [GTSAM] Noise model Constrained::MixedSigma slows down optimization
 
--
You received this message because you are subscribed to the Google Groups "gtsam users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtsam-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gtsam-users/CAPEyGhVDxur4tsK4Rsb4ORNu%2B2o6yYfWsRB1_%3DMsJantzAzNeA%40mail.gmail.com.

Philippe-Antoine Gohard

unread,
Sep 13, 2021, 9:41:07 AM9/13/21
to Dellaert, Frank, gtsam...@googlegroups.com
Hi Frank,

Many thanks for your answer. However, I was not referring to the calibration factor itself (PPP) but about the constrained::MixedSigmas noise model. I noticed that the constrained::MixedSigmas noise model slows down significantly (roughly 10 times) the computation in comparison with the Diagonal::Sigmas noise model. I was only able to test it on the PPP factor though, I am not sure whether this behaviour can also be observed using other factors.

I would have thought that using the Constrained::MixedSigmas should eventually accelerate the optimization, because setting the sigma to zero on components should simplify the computation of the jacobian, no ?

Best regards !
Philippe-Antoine

Dellaert, Frank

unread,
Sep 13, 2021, 4:04:10 PM9/13/21
to Philippe-Antoine Gohard, gtsam...@googlegroups.com
Ah, I see. No, unfortunately MixedSigmas *does* indeed cause us to use a slower, Gram-Schmidt factorization for those factors, rather than Eigen’s highly optimized QR step. It’s been long on the wishlist to improve that - and a motivated individual might be able to do it :-)

Frank

From: Philippe-Antoine Gohard <philippe-an...@easymile.com>
Sent: Monday, September 13, 2021 9:40:54 AM
To: Dellaert, Frank <frank.d...@cc.gatech.edu>
Cc: gtsam...@googlegroups.com <gtsam...@googlegroups.com>
Subject: Re: [GTSAM] Noise model Constrained::MixedSigma slows down optimization
 

Philippe-Antoine Gohard

unread,
Sep 14, 2021, 3:59:08 AM9/14/21
to Dellaert, Frank, gtsam...@googlegroups.com
Oh okay alright ! Many thanks for the explanation, I will try to look into it ! :)

Reply all
Reply to author
Forward
0 new messages