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

Added support for positioning in BayesNet plotting #1070

Merged
merged 10 commits into from
Jan 28, 2022
Merged

Conversation

dellaert
Copy link
Member

@dellaert dellaert commented Jan 27, 2022

  • added a field variablePositions in DotWriter
  • made method in BayesNet use them, if given
  • derived SymbolicBayesNet and GaussianBayesNet from BayesNet so they have this as well
  • removed obsolete code as a consequence
  • some slight reformatting here and there

This supports graphs in the book that look like this:

image

@dellaert dellaert requested a review from yetongumich January 27, 2022 04:29
@dellaert dellaert self-assigned this Jan 27, 2022
@dellaert dellaert added the high-priority Need this done quickly label Jan 27, 2022
Base automatically changed from fix/inference to develop January 27, 2022 04:34
Copy link
Contributor

@yetongumich yetongumich left a comment

Choose a reason for hiding this comment

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

LGTM with minor comments


for (auto conditional : *this) {
for (auto conditional : boost::adaptors::reverse(*this)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe a comment here why reversing the order? Like following a top-down order in printing?

Copy link
Member Author

Choose a reason for hiding this comment

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

It is because Bayes nets are typically specified in reverse topological sort order, that's how they come out of elimination. Will add comments in the next PR to not restart CI for this one thing

std::map<Key, Vector2> variablePositions;

/**
* The position hints allow one to use symbol character and index to specify
Copy link
Contributor

Choose a reason for hiding this comment

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

I like this functionality

Copy link
Contributor

Choose a reason for hiding this comment

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

Do we want to specify factor positions as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, forgot about that. will add. Currently in graphVizFormatting, actually, but I need it here.

@dellaert dellaert merged commit 84aed90 into develop Jan 28, 2022
@dellaert dellaert deleted the feauture/dotwriter branch January 28, 2022 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
high-priority Need this done quickly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants