geometric_kernels

Geometric kernels on manifolds, meshes and graphs

https://github.com/geometric-kernels/geometrickernels

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.9%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

Geometric kernels on manifolds, meshes and graphs

Basic Info
Statistics
  • Stars: 262
  • Watchers: 14
  • Forks: 19
  • Open Issues: 7
  • Releases: 7
Created over 4 years ago · Last pushed 9 months ago
Metadata Files
Readme Changelog Contributing License Code of conduct Citation

README.md

GeometricKernels

Quality checks and Tests Documentation Landing Page

GeometricKernels

GeometricKernels is a library that implements kernels — most importantly, heat and Matérn kernels — on non-Euclidean spaces such as Riemannian manifolds, graphs and meshes. This enables kernel methods — in particular Gaussian process models — to be deployed on such spaces.

Installation

  1. [Optionally] create and activate a new virtual environment.

    You can use Conda

    bash conda create -n [env_name] python=3.[version] conda activate [env_name]

    or virtualenv

    bash virtualenv [env_name] source [env_name]/bin/activate

  2. Install the library in the active environment by running

    bash pip install geometric_kernels

    If you want to install specific GitHub branch called [branch], run

    bash pip install "git+https://github.com/geometric-kernels/GeometricKernels@[branch]"

  3. Install a backend of your choice

    We use LAB to support multiple backends (e.g., TensorFlow, Jax, PyTorch). However, you are not required to install all of them on your system to use the GeometricKernels package. Simply install the backend (and (optionally) a GP package) of your choice. For example,

- [Tensorflow](https://www.tensorflow.org/)

    ```
    pip install tensorflow tensorflow-probability
    ```

    Optionally, you can install the Tensorflow-based Gaussian processes library [GPflow](https://github.com/GPflow/GPflow), for which we provide a frontend.

    ```
    pip install gpflow
    ```

- [PyTorch](https://pytorch.org/)

    ```
    pip install torch
    ```

    Optionally, you can install the PyTorch-based Gaussian processes library [GPyTorch](https://gpytorch.ai/), for which we provide a frontend.

    ```
    pip install gpytorch
    ```

- [JAX](https://jax.readthedocs.io/) (the cpu version)—the gpu and tpu versions can be installed [similarly](https://jax.readthedocs.io/en/latest/installation.html).

    ```
    pip install "jax[cpu]"
    ```

    Optionally, you can install the JAX-based Gaussian processes library [GPJax](https://github.com/JaxGaussianProcesses/GPJax), for which we provide a frontend.

    ```
    pip install gpjax
    ```

    **Note**. Currently, only some versions of `gpjax` are supported (we tested `gpjax==0.6.9`).

    Furthermore, installation might be far from trivial and result in a broken environment. This is due to our conflicting dependencies, see https://github.com/JaxGaussianProcesses/GPJax/issues/441.

A basic example

This example shows how to compute a 3x3 kernel matrix for the Matern52 kernel on the standard two-dimensional sphere. It relies on the numpy-based backend. Look up the information on how to use other backends in the documentation.

```python

Import a backend.

import numpy as np

Import the geometric_kernels backend.

import geometric_kernels

Import a space and an appropriate kernel.

from geometrickernels.spaces import Hypersphere from geometrickernels.kernels import MaternGeometricKernel

Create a manifold (2-dim sphere).

hypersphere = Hypersphere(dim=2)

Define 3 points on the sphere.

xs = np.array([[0., 0., 1.], [0., 1., 0.], [1., 0., 0.]])

Initialize kernel.

kernel = MaternGeometricKernel(hypersphere) params = kernel.init_params() params["nu"] = np.array([5/2]) params["lengthscale"] = np.array([1.])

Compute and print out the 3x3 kernel matrix.

print(np.around(kernel.K(params, xs), 2)) ```

This should output

[[1. 0.36 0.36] [0.36 1. 0.36] [0.36 0.36 1. ]]

Notebooks

You can find numerous example notebooks for GeometricKernels here in the docs or here in the tree. These cover every space (e.g., sphere, graph), backend (e.g., Torch, JAX), frontend (e.g., GPyTorch, GPflow), and more.

Application Examples

Looking for practical use cases of GeometricKernels? Check out

  • PeMS Regression: A benchmark suite for graph node regression with uncertainty. This project employs GeometricKernels among other tools, and offers processed data, baseline models, and an example notebook for experiments on graph-structured data. Notably, in this benchmark, geometric Gaussian processes built with GeometricKernels have been shown to outperform various alternative methods, including ensembles of graph neural networks and Bayesian graph neural networks.

  • Bayesian optimization demonstration: A minimal notebook illustrating the use of GeometricKernels with the botorch library for Bayesian optimization. This is a simple, self-contained example designed to demonstrate core concepts rather than to reflect a real-world scenario.

Documentation

The documentation for GeometricKernels is available on a separate website.

For development and running the tests

Run these commands from the root directory of the repository.

Install all backends and the dev requirements (Pytest, black, etc.)

bash make install

Run style checks bash make lint

Run the tests

bash make test

If you have a question

Post it in issues using the "How do I do ..." and other issues template and the "question" label.

This link chooses the right template and label for you.

Citation

If you are using GeometricKernels, please cite the following paper: @article{mostowsky2024, title = {The GeometricKernels Package: Heat and Matérn Kernels for Geometric Learning on Manifolds, Meshes, and Graphs}, author = {Peter Mostowsky and Vincent Dutordoir and Iskander Azangulov and Noémie Jaquier and Michael John Hutchinson and Aditya Ravuri and Leonel Rozo and Alexander Terenin and Viacheslav Borovitskiy}, year = {2024}, journal = {arXiv:2407.08086}, }

Furthermore, please consider citing the theoretical papers the package is based on. You can find the relevant references for any space in - the docstring of the respective space class, - at the end of the respective tutorial notebook.

Owner

  • Name: geometric-kernels
  • Login: geometric-kernels
  • Kind: organization

Citation (CITATION.bib)

@article{mostowsky2024,
      title = {The GeometricKernels Package: Heat and Matérn Kernels for Geometric Learning on Manifolds, Meshes, and Graphs},
      author = {Peter Mostowsky and Vincent Dutordoir and Iskander Azangulov and Noémie Jaquier and Michael John Hutchinson and Aditya Ravuri and Leonel Rozo and Alexander Terenin and Viacheslav Borovitskiy},
      year = {2024},
      journal = {arXiv:2407.08086},
}

GitHub Events

Total
  • Create event: 10
  • Release event: 6
  • Issues event: 7
  • Watch event: 51
  • Delete event: 2
  • Issue comment event: 11
  • Push event: 69
  • Pull request review comment event: 51
  • Pull request review event: 52
  • Pull request event: 6
  • Fork event: 4
Last Year
  • Create event: 10
  • Release event: 6
  • Issues event: 7
  • Watch event: 51
  • Delete event: 2
  • Issue comment event: 11
  • Push event: 69
  • Pull request review comment event: 51
  • Pull request review event: 52
  • Pull request event: 6
  • Fork event: 4

Issues and Pull Requests

Last synced: 8 months ago

All Time
  • Total issues: 2
  • Total pull requests: 2
  • Average time to close issues: over 2 years
  • Average time to close pull requests: 6 months
  • Total issue authors: 1
  • Total pull request authors: 2
  • Average comments per issue: 1.0
  • Average comments per pull request: 3.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • vabor112 (4)
  • ctr (1)
  • YanjunLiu2 (1)
Pull Request Authors
  • vabor112 (13)
  • aterenin (1)
  • imbirik (1)
  • cookbook-ms (1)
  • stoprightthere (1)
Top Labels
Issue Labels
bug (3) enhancement (2) question (1)
Pull Request Labels
enhancement (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 136 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 6
  • Total maintainers: 1
pypi.org: geometric_kernels

A Python Package offering geometric kernels in NumPy, TensorFlow, PyTorch, and Jax.

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 136 Last month
Rankings
Dependent packages count: 9.5%
Average: 36.1%
Dependent repos count: 62.8%
Maintainers (1)
Last synced: 8 months ago

Dependencies

dev_requirements.txt pypi
  • autoflake *
  • black *
  • flake8 *
  • ipykernel *
  • isort *
  • jupytext *
  • mypy *
  • nbconvert *
  • plotly *
  • polyscope *
  • pytest *
  • pytest-cov *
  • typing-extensions *
docs/requirements.txt pypi
  • sphinx *
  • sphinx_rtd_theme *
requirements.txt pypi
  • gpflow *
  • gpytorch *
  • jax *
  • jaxlib *
  • tensorflow *
  • tensorflow-probability ==0.14.0
  • torch *
.github/workflows/docs.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
.github/workflows/quality-checks.yaml actions
  • actions/checkout v2 composite
  • actions/setup-python v2 composite
pyproject.toml pypi
setup.py pypi