-
Notifications
You must be signed in to change notification settings - Fork 769
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
TransferFactor with numerical derivatives #1885
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dellaert
force-pushed
the
feature/tripletFactor
branch
from
October 25, 2024 00:37
02bfd20
to
895d446
Compare
dellaert
force-pushed
the
feature/tripletFactor
branch
from
October 25, 2024 14:36
33a5810
to
00cb637
Compare
PS I used |
akshay-krishnan
approved these changes
Oct 25, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Update
I realized that by batching all the points for a particular transfer config, the numerical derivatives will be much faster: while we have to twiddle up and down 14 times, now we get results for all the 2D points for that transfer.
Testing
Many unit tests, and example to show it optimizes to zero. Result of latter:
errors: size: 12 Factor 0: keys = { {0, 2} {1, 2} } error = 619.74 Factor 1: keys = { {0, 1} {1, 2} } error = 772.809 Factor 2: keys = { {0, 2} {0, 1} } error = 246.764 Factor 3: keys = { {1, 3} {2, 3} } error = 619.74 Factor 4: keys = { {1, 2} {2, 3} } error = 772.809 Factor 5: keys = { {1, 3} {1, 2} } error = 246.764 Factor 6: keys = { {2, 0} {3, 0} } error = 619.74 Factor 7: keys = { {2, 3} {3, 0} } error = 772.809 Factor 8: keys = { {2, 0} {2, 3} } error = 246.764 Factor 9: keys = { {3, 1} {0, 1} } error = 619.74 Factor 10: keys = { {3, 0} {0, 1} } error = 772.809 Factor 11: keys = { {3, 1} {3, 0} } error = 246.764 Initial error: 6557.25, values: 8 iter cost cost_change lambda success iter_time 0 86.3644 6.5e+03 1e+03 1 0 1 11 76 1e+02 1 0 2 0.066 11 10 1 0.01 3 2.4e-06 0.066 1 1 0 4 3.9e-10 2.4e-06 0.1 1 0 initial error = 6.6e+03 final error = 3.9e-10 Final results: Values with 8 values: Value {0, 1}: (gtsam::FundamentalMatrix) 5.5e-12 -0.0002 0.01 -0.0002 -1.9e-11 9e-10 0.01 0.02 -1 Value {0, 2}: (gtsam::FundamentalMatrix) 0.00017 3.5e-05 -0.01 3.5e-05 0.00017 -0.01 -0.01 -0.01 1 Value {1, 2}: (gtsam::FundamentalMatrix) 5.5e-12 -0.0002 0.01 -0.0002 -1.9e-11 9e-10 0.01 0.02 -1 Value {1, 3}: (gtsam::FundamentalMatrix) 0.00017 3.5e-05 -0.01 3.5e-05 0.00017 -0.01 -0.01 -0.01 1 Value {2, 0}: (gtsam::FundamentalMatrix) 0.00017 3.5e-05 -0.01 3.5e-05 0.00017 -0.01 -0.01 -0.01 1 Value {2, 3}: (gtsam::FundamentalMatrix) 5.5e-12 -0.0002 0.01 -0.0002 -1.9e-11 9e-10 0.01 0.02 -1 Value {3, 0}: (gtsam::FundamentalMatrix) 5.5e-12 -0.0002 0.01 -0.0002 -1.9e-11 9e-10 0.01 0.02 -1 Value {3, 1}: (gtsam::FundamentalMatrix) 0.00017 3.5e-05 -0.01 3.5e-05 0.00017 -0.01 -0.01 -0.01 1 Ground Truth F1: -5.2e-20 -0.0002 0.01 -0.0002 4e-21 8.3e-19 0.01 0.02 -1 Ground Truth F2: 0.0002 7.6e-20 -0.01 7.6e-20 0.0002 -0.01 -0.01 -0.01 1```