geometric_kernels
Geometric kernels on manifolds, meshes and graphs
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
Repository
Geometric kernels on manifolds, meshes and graphs
Basic Info
- Host: GitHub
- Owner: geometric-kernels
- License: apache-2.0
- Language: Python
- Default Branch: main
- Homepage: https://geometric-kernels.github.io/
- Size: 48.8 MB
Statistics
- Stars: 262
- Watchers: 14
- Forks: 19
- Open Issues: 7
- Releases: 7
Metadata Files
README.md
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
[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/activateInstall the library in the active environment by running
bash pip install geometric_kernelsIf you want to install specific GitHub branch called
[branch], runbash pip install "git+https://github.com/geometric-kernels/GeometricKernels@[branch]"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
botorchlibrary 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
- Repositories: 1
- Profile: https://github.com/geometric-kernels
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
Pull Request Labels
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.
- Documentation: https://geometric-kernels.github.io/
- License: Apache Software License
-
Latest release: 0.3.1
published 9 months ago
Rankings
Maintainers (1)
Dependencies
- autoflake *
- black *
- flake8 *
- ipykernel *
- isort *
- jupytext *
- mypy *
- nbconvert *
- plotly *
- polyscope *
- pytest *
- pytest-cov *
- typing-extensions *
- sphinx *
- sphinx_rtd_theme *
- gpflow *
- gpytorch *
- jax *
- jaxlib *
- tensorflow *
- tensorflow-probability ==0.14.0
- torch *
- actions/checkout v2 composite
- actions/setup-python v2 composite
- actions/checkout v2 composite
- actions/setup-python v2 composite
