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

Fix HybridGaussianFactorGraph error #1358

Merged
merged 18 commits into from
Dec 31, 2022
Merged

Conversation

varunagrawal
Copy link
Collaborator

@varunagrawal varunagrawal commented Dec 30, 2022

With Frank:

  • Store a FactorAndConstant in GaussianMixtureFactor, to properly account for different noise models for different modes. Small extra compute if they are all the same.

Frank fixed the ratios, and the marginals work out as well:

  • used HybridValues where possible.
  • define, unit test, and use logNormalizationConstant
  • define virtual error method.
  • because HybridDiscreteFactor now also defines an error, unequal mode priors are also properly handled (which was not the case before).

Now we are in a position where the factor graph is proportional to the joint, and we can think about elimination.

Base automatically changed from hybrid/model-selection to develop December 30, 2022 15:03
@dellaert
Copy link
Member

I will continue working in this branch. Please do not force-push ever.

@varunagrawal
Copy link
Collaborator Author

You got it!

@dellaert
Copy link
Member

Okidoke, I fixed the ratios, and the marginals work out as well. My main changes:

  • define, unit test, and use logNormalizationConstant
  • define virtual error method.
  • because HybridDiscreteFactor now also defines an error, unequal mode priors are also properly handled (which was not the case before).

Now we are in a position where the factor graph is proportional to the joint, and we can think about elimination.

@dellaert dellaert changed the title Update GaussianMixtureFactor Fix HybridGaussianFactorGraph error Dec 30, 2022
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.

I looked over everything - but of course I made a lot of the changes.

Copy link
Collaborator Author

@varunagrawal varunagrawal left a comment

Choose a reason for hiding this comment

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

Awesome sauce!

gtsam/hybrid/HybridGaussianFactor.h Show resolved Hide resolved
gtsam/hybrid/HybridGaussianFactor.h Outdated Show resolved Hide resolved
@varunagrawal
Copy link
Collaborator Author

I would probably have had one PR for all the virtual methods and overloads and another PR for the logNormalizationConstant to help keep track. Reviewing this was a bit of work.

@dellaert dellaert marked this pull request as ready for review December 30, 2022 23:47
@dellaert
Copy link
Member

Will merge and fix comments in next PR.

@dellaert dellaert merged commit be27e3a into develop Dec 31, 2022
@dellaert dellaert deleted the hybrid/gaussian-mixture-factor branch December 31, 2022 06:51
kartikarcot pushed a commit to kartikarcot/gtsam that referenced this pull request Jan 7, 2023
@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