forked from ThijsKuipers1995/gconv
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: implement octahedral lifting and separable kernels
- Loading branch information
Showing
7 changed files
with
325 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .kernel_se2 import GLiftingKernelSE2, GSeparableKernelSE2, GKernelSE2, RGLiftingKernelSE2 | ||
from .kernel_se3 import GLiftingKernelSE3, GSeparableKernelSE3, GKernelSE3, RGLiftingKernelSE3 | ||
from .kernel_se3 import GLiftingKernelSE3, GSeparableKernelSE3, GKernelSE3, RGLiftingKernelSE3, RGSeparableKernelSE3 | ||
from .kernel_so3 import GSubgroupKernelSO3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
from .gconv_se2 import GLiftingConvSE2, GSeparableConvSE2, GConvSE2, RGLiftingConvSE2 | ||
from .gconv_se3 import GLiftingConvSE3, GSeparableConvSE3, GConvSE3, RGLiftingConvSE3 | ||
from .gconv_se3 import GLiftingConvSE3, GSeparableConvSE3, GConvSE3, RGLiftingConvSE3, RGSeparableConvSE3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import torch | ||
|
||
def unsqueeze_like(tensor: torch.Tensor, like: torch.Tensor) -> torch.Tensor: | ||
""" Unsqueeze last dimensions of tensor to match another tensor's number of dimensions. | ||
:param tensor: tensor to unsqueeze | ||
:param like: tensor whose dimensions to match | ||
""" | ||
n_unsqueezes = like.ndim - tensor.ndim | ||
if n_unsqueezes < 0: | ||
raise ValueError(f"tensor.ndim={tensor.ndim} > like.ndim={like.ndim}") | ||
elif n_unsqueezes == 0: | ||
return tensor | ||
else: | ||
return tensor[(...,) + (None,) * n_unsqueezes] |