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

Add multi-batch support for SE(3) unary operators #512

Merged
merged 14 commits into from
May 4, 2023
Prev Previous commit
Next Next commit
refactor multi-batch SE3.Adjoint()
  • Loading branch information
fantaosha committed May 3, 2023
commit 4d88c9f82357a22caf875a7275aa30a2c52d4720
3 changes: 2 additions & 1 deletion theseus/labs/lie/functional/se3_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -587,14 +587,15 @@ def setup_context(cls, ctx, inputs, outputs):
@classmethod
def backward(cls, ctx, grad_output):
group: torch.Tensor = ctx.saved_tensors[0]
size = group.shape[:-2]
grad_input_rot = (
grad_output[..., :3, :3]
+ grad_output[..., 3:, 3:]
- SO3._hat_impl(group[..., 3]) @ grad_output[..., :3, 3:]
)
grad_input_t = SO3._project_impl(
grad_output[..., :3, 3:] @ group[..., :3].transpose(-2, -1)
).view(-1, 3, 1)
).view(*size, 3, 1)

return torch.cat((grad_input_rot, grad_input_t), dim=-1)

Expand Down