Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@varunagrawal
Copy link
Contributor

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 requested a review from dellaert March 24, 2022 16:00
@varunagrawal varunagrawal self-assigned this Mar 24, 2022
@varunagrawal
Copy link
Contributor 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
Contributor 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.

3 participants