Skip to content

Fix Hybrid Elimination with empty discrete factors#2090

Merged
varunagrawal merged 8 commits intodevelopfrom
fix/decisiontreefactor-restrict
Apr 13, 2025
Merged

Fix Hybrid Elimination with empty discrete factors#2090
varunagrawal merged 8 commits intodevelopfrom
fix/decisiontreefactor-restrict

Conversation

@varunagrawal
Copy link
Copy Markdown
Contributor

When applying HybridNonlinearFactorGraph::restrict, if we have discrete priors, we restrict them. However, the factors get reintroduced as uniform priors in the relinearization step.

f [ ]
  Leaf: 0.5

This adds unnecessary expense to the hybrid elimination.

This PR fixes this issue so we have constant time updates.

@varunagrawal varunagrawal requested a review from dellaert April 13, 2025 14:44
@varunagrawal varunagrawal self-assigned this Apr 13, 2025
Copy link
Copy Markdown
Member

@dellaert dellaert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve modulo improving source doc to help our future selves :-) (and me - I don't fully understand how the code changes relate to the PR comment)

ADT restricted_tree = ADT::restrict(assignment);
return std::make_shared<DecisionTreeFactor>(this->discreteKeys(),
restricted_tree);
DiscreteKeys restricted_keys = this->discreteKeys();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add comments as to what is happening and why?

@varunagrawal varunagrawal merged commit 8a1c412 into develop Apr 13, 2025
36 checks passed
@varunagrawal varunagrawal deleted the fix/decisiontreefactor-restrict branch April 13, 2025 18:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants