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

Some refactoring and new test #1349

Merged
merged 5 commits into from
Dec 27, 2022
Merged

Some refactoring and new test #1349

merged 5 commits into from
Dec 27, 2022

Conversation

dellaert
Copy link
Member

@varunagrawal I refactored the test (and a bit of the elimination code). I expected a normalized DiscreteConditional on m after elimination, rather than an unnormalized factor. I propose you approve and merge this PR and then let's discuss about why that's not true.

@varunagrawal
Copy link
Collaborator

I expected a normalized DiscreteConditional on m after elimination, rather than an unnormalized factor.

Working on this, #1343 is the WIP PR. I'm having a bit of trouble initializing the updated HessianFactor (with Info matrix multiplied by normalized value) since there is no constructor for the Hessian factor that takes just a matrix, and the one for the SymmetricBlockMatrix needs the block dimensions which we don't have access to (these are protected methods).

}

/*********************************************************************************
// Create a hybrid nonlinear factor graph f(x0, x1, m0; z0, z1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This docstring should say "Create a hybrid linear/gaussian factor graph", right?

return discreteElimination(factors, frontalKeys);
}

} else {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Any particular reason for this nesting? Even an else if will only evaluate if discrete_only is false.

@@ -99,6 +99,7 @@ std::function<double(const Assignment<Key> &, double)> prunerFunc(
}

/* ************************************************************************* */
// TODO(dellaert): what is this non-const method used for? Abolish it?
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is used internally to update the BayesNet with the pruned conditionals after pruning them based on the prunedDecisionTree.

@varunagrawal varunagrawal merged commit cfcbdda into hybrid/tests Dec 27, 2022
@varunagrawal varunagrawal deleted the hybrid/two_ways branch December 29, 2022 02:21
@dellaert dellaert added this to the Hybrid Inference milestone Feb 7, 2023
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