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

Print parents when printing GaussianConditional #1143

Merged
merged 2 commits into from
Mar 24, 2022

Conversation

varunagrawal
Copy link
Collaborator

Currently, GaussianConditionals don't print the parents, only the frontals. This PR fixes that.

For the following conditional

auto conditional =
      GaussianConditional::FromMeanAndStddev(X(0), A1, X(1), b, sigma);

which is just P(X0 | X1).

Before

GaussianConditional  Conditional density [x0] 
  R = [ 1 0 ]
      [ 0 1 ]
  S[x1] = [ -1 -2 ]
          [ -3 -4 ]
  d = [ 20 40 ]
isotropic dim=2 sigma=3

After

Conditional density [x0 | x1]
  R = [ 1 0 ]
      [ 0 1 ]
  S[x1] = [ -1 -2 ]
          [ -3 -4 ]
  d = [ 20 40 ]
isotropic dim=2 sigma=3

@varunagrawal varunagrawal added bugfix Fixes an issue or bug quick-review Quick and easy PR to review labels Mar 24, 2022
@varunagrawal varunagrawal self-assigned this Mar 24, 2022
@varunagrawal
Copy link
Collaborator Author

NOTE: I've converted the default print pre-text to empty string rather than GaussianConditional (since it is already printing Conditional density). Please let me know if I should undo this.

@dellaert
Copy link
Member

NOTE: I've converted the default print pre-text to empty string rather than GaussianConditional (since it is already printing Conditional density). Please let me know if I should undo this.

I would prefer if you keep the default, but remove the redundant Conditional density. Also, maybe actually do print p(x0 | x1). Note lowercase p because it's a density, not a probability mass function.

@varunagrawal
Copy link
Collaborator Author

@dellaert done, here is the new output:

GaussianConditional p(x0 | y0 y1)
  R = [ 1 0 ]
      [ 0 1 ]
  S[y0] = [ -1 -2 ]
          [ -3 -4 ]
  S[y1] = [ -5 -6 ]
          [ -7 -8 ]
  d = [ 20 40 ]
isotropic dim=2 sigma=3

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.

Cool beans!

@varunagrawal varunagrawal marked this pull request as draft March 24, 2022 20:14
@varunagrawal varunagrawal marked this pull request as ready for review March 24, 2022 20:14
@varunagrawal varunagrawal reopened this Mar 24, 2022
@varunagrawal varunagrawal merged commit c693d7d into develop Mar 24, 2022
@varunagrawal varunagrawal deleted the fix/gaussian-conditional-print branch March 24, 2022 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Fixes an issue or bug quick-review Quick and easy PR to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants