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

printErrors method for HybridFactorGraph #1670

Merged
merged 13 commits into from
Jan 7, 2024
Merged

Conversation

varunagrawal
Copy link
Collaborator

@varunagrawal varunagrawal commented Nov 14, 2023

Added printErrors to HybridNonlinearFactorGraph and HybridGaussianFactorGraph to aid with debugging.

Also added error method to HybridBayesNet.

Example output for a HybridGaussianFactorGraph with 3 factors. Note that it prints the factors along with the error right after each factor.

HybridGaussianFactorGraph: size: 3
Factor 0: Hybrid [x0; m0]{
 Choice(m0) 
 0 Leaf :
  A[x0] = [
	-1, -0, -0;
	-0, -1, -0;
	-0, -0, -1;
	0, 0, 0
]
  b = [      -1      -2      -5 5.25652 ]
  Noise model: diagonal sigmas [10; 10; 10; 1];
 1 Leaf :
  A[x0] = [
	-1, -0, -0;
	-0, -1, -0;
	-0, -0, -1
]
  b = [ -1 -2 -5 ]
isotropic dim=3 sigma=0.1
}
error =  Choice(m0) 
 0 Leaf 13.815511
 1 Leaf    0


Factor 1: p(x0)
  R = [ 1 0 0 ]
      [ 0 1 0 ]
      [ 0 0 1 ]
  d = [ 1 2 5 ]
  mean: 1 elements
  x0: 1 2 5
isotropic dim=3 sigma=0.5
error = 0

Factor 2:  P( m0 ):
 Choice(m0) 
 0 Leaf  0.4
 1 Leaf  0.6
error =  Choice(m0) 
 0 Leaf 0.91629073
 1 Leaf 0.51082562

@varunagrawal varunagrawal self-assigned this Nov 14, 2023
Copy link
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.

LGTM!
Might be nice to show example output in the MR comment before merging, for posterity,

Base automatically changed from discrete-error to develop January 7, 2024 18:05
@varunagrawal varunagrawal merged commit 7cd46f8 into develop Jan 7, 2024
30 checks passed
@varunagrawal varunagrawal deleted the hybrid-printerrors branch January 7, 2024 18:31
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