SCOTT: Synthesizing Curvature Operations and Topology Tools. Use curvature filtrations for graphs and graph distributions!
Project description
SCOTT
Synthesizing Curvature Operations and Topological Tools
SCOTT is a Python package for computing curvature filtrations for graphs and graph distributions. This repository accompanies our NeurIPS 2023 paper: Curvature Filtrations for Graph Generative Model Evaluation.
Our method introduces a novel way to compare graph distributions, avoiding the limitations of Maximal Mean Discrepancy (MMD), which has known drawbacks.
By combining discrete curvature on graphs with persistent homology, SCOTT provides expressive descriptors of graph sets that are:
- Robust
- Stable
- Expressive
- Compatible with Statistical Testing
The package is highly adaptable, offering several options for user customization, including different curvature computation methods and diverse metrics for comparing persistent homology outputs.
Cite Us
If you find this package useful in your research, please consider citing:
@misc{southern2023curvature,
title={Curvature Filtrations for Graph Generative Model Evaluation},
author={Joshua Southern and Jeremy Wayland and Michael Bronstein and Bastian Rieck},
year={2023},
eprint={2301.12906},
archivePrefix={arXiv},
primaryClass={cs.LG}
}
Installation
Using pip
Install curvature-filtrations via pip:
$ pip install curvature-filtrations
Building from Source
Our dependencies are managed with poetry, which can be installed with pip install poetry. To install from source:
- Clone the repository
$ git clone https://github.com/aidos-lab/curvature-filtrations.git
- Navigate to the directory
$ cd curvature-filtrations
- Install dependencies
$ poetry install
Quick Start
The example.py script demonstrates how to compute the distance between two graph distributions.
To use SCOTT with your own data, replace the example graph distributions with your own. Distributions should be lists of networkx graphs or single networkx graphs.
Run our Example Script
python scripts/example.py
Core Components
KILT
KILT stands for: Krvature-Informed Links and Topology is an object that can compute curvature filtrations for single graphs.
import networkx as nx
from scott import KILT,Comparator
G = nx.erdos_reyni(14,0.4)
kilt = KILT(measure="forman_curvature")
D = kilt.fit_transform(G)
print(f"Forman Curvature Filtration:")
print(f"Curvature Filtration Values:{kilt.curvature}")
print(D)
Comparator
Comparator handles comparisons between graphs or graph distributions!
import networkx as nx
from scott import KILT,Comparator
graph_dist1 = [nx.erdos_reyni(10,0.4) for _ in range(40)]
graph_dist2 = [nx.erdos_reyni(20,0.6) for _ in range(50)]
compare = Compare(measure="forman_curvature")
dist = compare.fit_transform(graph_dist1,graph_dist2,metric="image")
print(f"Distance between distributions measured by Forman Filtration: {dist}")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file curvature_filtrations-0.1.0.tar.gz.
File metadata
- Download URL: curvature_filtrations-0.1.0.tar.gz
- Upload date:
- Size: 20.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.5 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d7f6d3840f4c711eebf91e879ea8b354e4a22c2c0c30c508780ed4e80a842960
|
|
| MD5 |
53e43d2da5eb7d51a05aeec89a6b0820
|
|
| BLAKE2b-256 |
53a3d34962b6dba538e376b87f5980fc6ff78fc245991bfbffc7044e36788da6
|
File details
Details for the file curvature_filtrations-0.1.0-py3-none-any.whl.
File metadata
- Download URL: curvature_filtrations-0.1.0-py3-none-any.whl
- Upload date:
- Size: 23.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.12.5 Darwin/23.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da27c153c8bc525cc0d1c47afab215a90a522dfde0cce8283b6026c0309f0778
|
|
| MD5 |
c31c880d803e3705455c489da32ef9e6
|
|
| BLAKE2b-256 |
a59bdc67c46fc7b774b8044aa81bcee4367563bc6eab2d5f143fa533aa10efd4
|