Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ Run the tests
make test
```

**Example:** If you want to learn how to implement your own space or kernel component, checkout the [CustomSpacesAndKernels.ipynb](https://github.com/geometric-kernels/GeometricKernels/blob/main/notebooks/CustomSpacesAndKernels.ipynb) notebook.

## If you have a question

Post it in issues using the `"How do I do ..." and other issues` template and the "question" label.
Expand Down
1 change: 1 addition & 0 deletions docs/examples/CustomSpacesAndKernels.nblink
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"path": "../../notebooks/CustomSpacesAndKernels.ipynb"}
1 change: 1 addition & 0 deletions docs/examples/examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Spaces
.. toctree::
:titlesonly:

Custom Spaces and Kernels <CustomSpacesAndKernels>
Graph <Graph>
GraphEdges <GraphEdges>
Hyperbolic <Hyperbolic>
Expand Down
2 changes: 2 additions & 0 deletions docs/examples/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ If you are interested in using GeometricKernels with a backend other than NumPy,

If you want to use GeometricKernels with one of the popular Gaussian process libraries, checkout the *Frontends* notebooks.

If you want to learn how to implement your own space or kernel component, checkout `CustomSpacesAndKernels.ipynb <CustomSpacesAndKernels.html>`_ notebook.

Finally, if you are interested in application examples:

* `PeMS Regression <https://github.com/vabor112/pems-regression>`__
Expand Down
13 changes: 11 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -395,9 +395,18 @@ You can find more examples :doc:`here <examples/index>`.
Citation
========

If you are using GeometricKernels, please consider citing the theoretical papers it is based on.
If you are using GeometricKernels, please cite the `library paper <https://arxiv.org/pdf/2407.08086>`__:

You can find the relevant references for any space in
.. code-block:: latex

@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},
}

Please also consider citing the theoretical papers the library 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.
Expand Down
5 changes: 2 additions & 3 deletions geometric_kernels/spaces/graph_edges.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@

import lab as B
import numpy as np
from beartype.door import is_bearable
from beartype.typing import Dict, List, Optional, Tuple, Union
from scipy.sparse import csr_matrix, lil_matrix
from scipy.sparse import csr_matrix, issparse, lil_matrix

from geometric_kernels.lab_extras import (
SparseArray,
Expand Down Expand Up @@ -447,7 +446,7 @@ def from_adjacency( # noqa: C901
"""
if isinstance(adjacency_matrix, np.ndarray):
index = csr_matrix(adjacency_matrix, dtype=int)
elif is_bearable(adjacency_matrix, SparseArray):
elif issparse(adjacency_matrix):
index = csr_matrix(adjacency_matrix, dtype=int, copy=True)
else:
raise ValueError(
Expand Down
Loading