geomstats.varifold package#

Subpackages#

Submodules#

geomstats.varifold.base module#

Base objects for varifold implementation.

class geomstats.varifold.base.Pairing[source]#

Bases: ABC

Kernel pairing.

geomstats.varifold.kernel module#

Kernel pairings.

geomstats.varifold.kernel.GaussianBinetPairing(sigma, backend='auto')[source]#

Instantiate a Gaussian-Binet kernel pairing.

This pairing is defined by

\[K(x, y, u, v) = exp(-||x - y||^2 / sigma^2) * <u, v>^2\]
Parameters:
  • sigma (float) – Positive bandwidth parameter of the Gaussian kernel.

  • backend ({“auto”, “torch”, “keops”, “keops_genred”, “keops_lazy”}) – Implementation backend.

    • “auto”: Select an implementation automatically (typically prefers a KeOps-based implementation when available, otherwise falls back to a Torch/NumPy implementation).

    • “backend”: Dense implementation using the current geomstats backend.

    • “keops”: Alias for “keops_genred”.

    • “keops_genred”: KeOps implementation using Genred reductions.

    • “keops_lazy”: KeOps LazyTensor-based implementation.

Returns:

Pairing – An object implementing the kernel pairing.

Notes

The dense (“backend”) implementation materializes pairwise matrices and is memory-bound for large inputs. KeOps-based implementations avoid forming the full kernel matrix and are more efficient for large-scale problems.

The “auto” backend does not guarantee optimal performance in all cases, but provides a reasonable default based on available dependencies.

Module contents#