Skip to content

Homogeneous spaces: Stiefel and Grassmann manifolds#156

Draft
vabor112 wants to merge 67 commits into
mainfrom
homogeneous_spaces_v2
Draft

Homogeneous spaces: Stiefel and Grassmann manifolds#156
vabor112 wants to merge 67 commits into
mainfrom
homogeneous_spaces_v2

Conversation

@vabor112
Copy link
Copy Markdown
Member

Finalizing the support of Stationary Kernels and Gaussian Processes on Lie Groups and their Homogeneous Spaces I: the compact case (https://arxiv.org/abs/2208.14960).

Copy link
Copy Markdown
Member Author

@vabor112 vabor112 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR draft. Here's some things to do:

  • Make sure to put type annotations wherever possible, as well as docstrings describing all parameters and return values, in the same style as in other modules.
  • Make sure checks are successful (it's important that you do this as it might be nontrivial to fix some things, e.g. when some backends work and some don't because of the constructions that you use).
  • Make sure there are no errors in the notebooks.
  • Add tests: for instance, check averaging converges to the analytic spherical functions for Grassmannian, check that when Stiefel/Grassmannian reduce to simple special cases, such as SO or sphere, they align with the spaces already implemented in the library.

Also there are a few comments attached to the specific places in code.

kernel.num_levels,
MaternGeometricKernel._DEFAULT_NUM_RANDOM_PHASES,
)
if isinstance(kernel.space, CompactHomogeneousSpace):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is this separateif only to set different default_num?

@overload
def feature_map_from_kernel(kernel: MaternKarhunenLoeveKernel):
if isinstance(kernel.space, CompactMatrixLieGroup):
if isinstance(kernel.space, CompactMatrixLieGroup) or isinstance(kernel.space, Grassmannian):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

For some reason, in feature_map_from_space below, the behavior is different

@overload
def default_num(space: DiscreteSpectrumSpace) -> int:
if isinstance(space, CompactMatrixLieGroup):
if isinstance(space, CompactMatrixLieGroup) or isinstance(space, CompactHomogeneousSpace):
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I'd suggest to introduce a separate _DEFAULT_NUM_LEVELS_COMPACT_HOMOGENEOUS, it might be equal to _DEFAULT_NUM_LEVELS_LIE_GROUP

Comment thread geometric_kernels/spaces/lie_groups.py Outdated
X2_inv = self.inverse(X2)
X_ = B.tile(X[..., None, :, :], 1, X2_inv.shape[0], 1, 1) # (N, N2, n, n)
X2_inv_ = B.tile(X2_inv[None, ..., :, :], X.shape[0], 1, 1, 1) # (N, N2, n, n)
if inverse_X:
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Why did you need to change Lie groups stuff? The change is not backend-independent btw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants