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

Refactor SO3 and SE3 to be consistent with functorch #266

Merged
merged 25 commits into from
Sep 7, 2022

Conversation

fantaosha
Copy link
Contributor

@fantaosha fantaosha commented Aug 8, 2022

Motivation and Context

How Has This Been Tested

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 8, 2022
@fantaosha fantaosha requested review from luisenp and mhmukadam August 8, 2022 21:28
@fantaosha fantaosha self-assigned this Aug 8, 2022
@fantaosha fantaosha added the enhancement New feature or request label Aug 8, 2022
theseus/geometry/se3.py Outdated Show resolved Hide resolved
Copy link
Contributor

@mhmukadam mhmukadam left a comment

Choose a reason for hiding this comment

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

Looks good so far. Left a few comments.

Copy link
Contributor

@mhmukadam mhmukadam left a comment

Choose a reason for hiding this comment

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

Besides the context name update looks ready to me.

Copy link
Contributor

@luisenp luisenp left a comment

Choose a reason for hiding this comment

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

LGMT, but need to change some of the warning messages. We can add this to #268 to make it easier.

tensor = self._check_tensor(tensor, strict)
else:
warnings.warn(
f"functorch is enabled and tensor is not checked "
Copy link
Contributor

Choose a reason for hiding this comment

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

We should change this message as well, since this now has nothing to do with functorch. Maybe "Lie group consistency checks are disabled."? Feel free to change in #268 if that's easier.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yeah, good catch!

)
else:
warnings.warn(
"functorch is enabled and the skew-symmetry of hat matrices is "
Copy link
Contributor

Choose a reason for hiding this comment

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

Need to change this message as well. How about "Lie group checks are disabled, so the skew-symmetry... etc."?

_check &= torch.allclose(matrix[:, 0, 1], -matrix[:, 1, 0])
else:
warnings.warn(
"functorch is enabled and the skew-symmetry of hat matrices is "
Copy link
Contributor

Choose a reason for hiding this comment

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

Also change this message.

@fantaosha fantaosha merged commit 36a1b32 into main Sep 7, 2022
@mhmukadam mhmukadam deleted the taoshaf.refactor_lie_group_for_functorch branch September 7, 2022 21:24
suddhu pushed a commit to suddhu/theseus that referenced this pull request Jan 21, 2023
…h#266)

* fixed some bugs in SO3.log_map

* refactor SO3 to be consistent with functorch

* fixed a bug in SO3._project_impl

* add more tests for SO3

* SE3 refactored to be consistent with functorch

* simplify SO3 and SE3 for functorch

* refactor so2 to be consistent with functorch

* torch.zeros() -> tensor.new_zeros()

* simplify the code using new_zeros

* refactor se2

* refactor the projection map for SE3

* fixed a bug in SO2._rotate_from_cos_sin

* fixed a bug for functorch

* refactor SO3.log_map_impl

* refactor SO3 and remove functorch context for log_map_impl() and to_quaternion()

* refactor SE3._log_map_impl

* SO3 refactored

* functorhc refactored

* add more warning info for functorch

* fixed a bug in warnings message about tensor check for functorch

* rename functorch context

* rename lie_group_tensor to lie_group

* some changes are made

* rename lie_group_tensor_check to lie_group_check

* fixed the logic bug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants