Added TableFactor, a discrete factor optimized for sparsity.#1528
Merged
Conversation
Contributor
Author
dellaert
reviewed
May 23, 2023
| using Binary = std::function<double(const double, const double)>; | ||
|
|
||
| public: | ||
| /** The Real ring with addition and multiplication */ |
Member
There was a problem hiding this comment.
somehow thought we already had that in a base class?
Contributor
Author
There was a problem hiding this comment.
Its in AlgebraicDecisionTree. I didn't want to include it into TableFactor but I we can use the one implemented in AlgebraicDecisionTree.
Member
|
I don't see any changes yet - send me an email when I should start CI again. |
added 6 commits
May 28, 2023 13:08
dellaert
approved these changes
Jun 7, 2023
Member
dellaert
left a comment
There was a problem hiding this comment.
Amazing work, Yoonwoo!
I will merge, as all unit tests succeed. @varunagrawal there is a possibility this could speed up Hybrid inference by a lot.
Contributor
|
FYI, this appears to use boost/format even if boost features are disabled in cmake. |
This file contains hidden or 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
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.
Summary
TableFactor is a discrete probabilistic factor that can replace DecisionTreeFactor.
It should support all features that the current DecisionTreeFactor has such as multiplication, division, sum, and max.
It was developed for faster MAP inference on CSP and Classical Planning problems where discrete state space is very sparse.
Unittest includes a runtime benchmark between TableFactor and DecisionTreeFactor given various sparsity.
Supports cardinality up to 18446744073709551615.
What is the solution?
Relies on Eigen3's SparseVector data structure. Multiplication and division use the tensor contraction method proposed in SPARTA.
What areas of GTSAM does it impact?
gtsam/discrete
How to test?
run provided unit test (testTableFactor.cpp)
Other Notes
In-depth implementation details are in thesis's chapter 4.
Runtime comparison between DecisionTreeFactor and TableFactor on Macbook pro M1 chip.