Skip to content

New docs: hybrid#2120

Merged
varunagrawal merged 29 commits intodevelopfrom
docs-hybrid
Nov 30, 2025
Merged

New docs: hybrid#2120
varunagrawal merged 29 commits intodevelopfrom
docs-hybrid

Conversation

@p-zach
Copy link
Copy Markdown
Member

@p-zach p-zach commented May 1, 2025

New docs for hybrid folder. There were a lot of classes in here that had many, many functions that were not yet wrapped. Frank also exposed AlgebraicDecisionTreeKey for methods like errorTree().

Finished Notebooks

  • HybridSmoother
  • HybridValues
  • HybridBayesTree
  • HybridFactor
  • HybridBayesNet
  • HybridConditional
  • HybridEliminationTree
  • HybridFactorGraph
  • HybridGaussianConditional
  • HybridGaussianFactor
  • HybridGaussianFactorGraph
  • HybridGaussianISAM
  • HybridGaussianProductFactor
  • HybridJunctionTree
  • HybridNonlinearFactor
  • HybridNonlinearFactorGraph
  • HybridNonlinearISAM

@dellaert dellaert marked this pull request as ready for review May 26, 2025 13:44
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.

Thanks @p-zach !!! I fixed all remaining wrapper issues

@dellaert
Copy link
Copy Markdown
Member

@varunagrawal FYI

Copy link
Copy Markdown
Contributor

@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.

Okay this PR is a very nice effort, but I am not comfortable with the wrapping for 2 reasons:

  1. Lack of tests: whatever I wrapped, I extensively unit tested, and my own work allowed for integration testing.
  2. Verification with the Matlab wrapper. The matlab wrapper is more finicky than the python wrapper since it cares a whole lot more about return types and other smaller details. I don't see if this was checked (CI doesn't do it).

Moreover, I want to land other hybrid related PRs first (such as DCSAM) and include a new class called Key[Algebraic]DecisionTree which specializes AlgebraicDecisionTree<Key> to make its use much easier and cleaner. It's a low priority item since it simplifies the API but is a lot of effort for a single developer (aka me).

I am not selecting Request changes (which would be the right way to go), but I DO NOT recommend merging this yet.

template <>
struct traits<HybridFactor> : public Testable<HybridFactor> {};

// For wrapper:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The reason I haven't wrapped a lot of stuff in hybrid is primarily because of this class, and also because I want to add a new class called KeyDecisionTree which specializes the template AlgebraicDecisionTree.

This would have many benefits since we wouldn't have to always pass in keyFormatter arguments, and wrapping would be a cinch, but it is a big PR which is lower priority than some others (such as DCSAM).

const gtsam::VectorValues& frontals) const;
double logProbability(const gtsam::HybridValues& values) const;
double evaluate(const gtsam::HybridValues& values) const;
// double operator()(const gtsam::HybridValues &values) const;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This should just work right?

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.

Try?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I tried this but I am getting an error from Pybind11. This is due to the fact that there are two operator() methods (i.e. it is overloaded), and the binding code generated is

.def("__call__", &gtsam::HybridGaussianConditional::operator());

which cannot disambiguate between the two operator() overloads in HybridGaussianConditional since there is no specification of the argument types. There is a way to fix this but it will need more wrapper updates, so commenting this out until then.

Copy link
Copy Markdown
Contributor

@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.

Please verify the matlab wrapper compiles and update the restrict method.

@varunagrawal
Copy link
Copy Markdown
Contributor

Couple of things:

  1. I don't think my review comments were addressed?
  2. The Matlab wrapper is indeed not compiling. Apparently it's been this PR along with 5 others that have caused it to break.

Copy link
Copy Markdown
Contributor

@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.

Fixed everything so this should be good to go. :)

@varunagrawal
Copy link
Copy Markdown
Contributor

@dellaert can you take one more look at this to make sure it matches your expectations? There were some merge conflicts which I fixed, so wanted to get your sign off on those.

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.

Great! Two minor comments.

const gtsam::VectorValues& frontals) const;
double logProbability(const gtsam::HybridValues& values) const;
double evaluate(const gtsam::HybridValues& values) const;
// double operator()(const gtsam::HybridValues &values) const;
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.

Try?

@varunagrawal varunagrawal merged commit 9db8d95 into develop Nov 30, 2025
34 checks passed
@varunagrawal varunagrawal deleted the docs-hybrid branch November 30, 2025 01:27
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.

3 participants