RBF MMD Metrics
MMD metrics using RBF kernels with dynamic bandwidths, as proposed by Thompson et al. [1].
The following graph descriptors are available:
Graph Descriptors
OrbitCounts: Counts of different graphlet orbitsClusteringHistogram: Distribution of clustering coefficientsSparseDegreeHistogram: Distribution of node degreesEigenvalueHistogram: Distribution of graph Laplacian eigenvaluesRandomGIN: Graph Neural Network embedding of the graph, combined with a normalization layer (NormalizedDescriptor). Proposed by Thompson et al. [1].
Below, we demonstrate how to evaluate all metrics in the benchmark with point estimates and with uncertainty quantification.
from polygraph.datasets import PlanarGraphDataset, SBMGraphDataset
from polygraph.metrics import RBFMMD2Benchmark, RBFMMD2BenchmarkInterval
reference = list(PlanarGraphDataset("val").to_nx())
generated = list(SBMGraphDataset("val").to_nx())
# Evaluate the benchmark with point estimates
benchmark = RBFMMD2Benchmark(reference[:20])
print(benchmark.compute(generated[:20]))
# Evaluate the benchmark with uncertainty quantification
benchmark_with_uncertainty = RBFMMD2BenchmarkInterval(
reference,
subsample_size=20,
num_samples=100,
coverage=0.95,
)
print(benchmark_with_uncertainty.compute(generated))
References
[1] Thompson, R., Knyazev, B., Ghalebi, E., Kim, J., & Taylor, G. W. (2022). On Evaluation Metrics for Graph Generative Models. In International Conference on Learning Representations (ICLR).
Summary Benchmark
polygraph.metrics.RBFMMD2Benchmark
Bases: MetricCollection[Graph]
Collection of MMD2 metrics using RBF kernels with dynamic bandwidths.
| Parameters: |
|
|---|
polygraph.metrics.RBFMMD2BenchmarkInterval
Bases: MetricCollection[Graph]
Collection of MMD2 metrics using RBF kernels with dynamic bandwidths and uncertainty quantification.
| Parameters: |
|
|---|
Orbit Counts
Metrics based on counting graph orbits (small subgraph patterns).
polygraph.metrics.rbf_mmd.RBFOrbitMMD2
Bases: MaxDescriptorMMD2[Graph]
polygraph.metrics.rbf_mmd.RBFOrbitMMD2Interval
Bases: MaxDescriptorMMD2Interval[Graph]
Degree Distribution
Metrics based on the distribution of node degrees in the graph.
polygraph.metrics.rbf_mmd.RBFDegreeMMD2
Bases: MaxDescriptorMMD2[Graph]
polygraph.metrics.rbf_mmd.RBFDegreeMMD2Interval
Bases: MaxDescriptorMMD2Interval[Graph]
Clustering Coefficients
Metrics based on local clustering patterns in the graph.
polygraph.metrics.rbf_mmd.RBFClusteringMMD2
Bases: MaxDescriptorMMD2[Graph]
polygraph.metrics.rbf_mmd.RBFClusteringMMD2Interval
Bases: MaxDescriptorMMD2Interval[Graph]
Spectral Properties
Metrics based on the eigenvalue spectrum of the graph.
polygraph.metrics.rbf_mmd.RBFSpectralMMD2
Bases: MaxDescriptorMMD2[Graph]
polygraph.metrics.rbf_mmd.RBFSpectralMMD2Interval
Bases: MaxDescriptorMMD2Interval[Graph]
GNN Features
Metrics based on features of a randomly initialized GIN network.
polygraph.metrics.rbf_mmd.RBFGraphNeuralNetworkMMD2
Bases: MaxDescriptorMMD2[Graph]
polygraph.metrics.rbf_mmd.RBFGraphNeuralNetworkMMD2Interval
Bases: MaxDescriptorMMD2Interval[Graph]