Standard PolyGraphDiscrepancy
StandardPGD is a PolyGraphDiscrepancy metric based on six different 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].
By default, we use TabPFN for binary classification and evaluate it by data log-likelihood, obtaining a PolyGraphDiscrepancy that provides an estimated lower bound on the Jensen-Shannon distance between the generated and true graph distribution.
This metric is implemented in the StandardPGD class and can be used as follows:
from polygraph.datasets import PlanarGraphDataset, SBMGraphDataset
from polygraph.metrics import StandardPGD
reference = PlanarGraphDataset("val").to_nx()
generated = SBMGraphDataset("val").to_nx()
benchmark = StandardPGD(reference)
print(benchmark.compute(generated)) # {'pgd': 0.9902651620251016, 'pgd_descriptor': 'clustering', 'subscores': {'orbit': 0.9962500491652303, 'clustering': 0.9902651620251016, 'degree': 0.9975117559449073, 'spectral': 0.9634302070519823, 'gin': 0.994213920319544}}
We also provide classes that implement individual ClassifierMetrics:
ClassifierOrbit4Metric: Classifier metric based onOrbitCountsClassifierOrbit5Metric: Classifier metric based onOrbitCountsClassifierClusteringMetric: Classifier metric based onClusteringHistogramClassifierDegreeMetric: Classifier metric based onSparseDegreeHistogramClassifierSpectralMetric: Classifier metric based onEigenvalueHistogramGraphNeuralNetworkClassifierMetric: Classifier metric based onRandomGIN
StandardPGD
polygraph.metrics.StandardPGD
Bases: PolyGraphDiscrepancy[Graph]
PolyGraphDiscrepancy metric that combines six different graph descriptors.
By default, we use TabPFN for binary classification and evaluate it by data log-likelihood, obtaining a PolyGraphDiscrepancy that provides an estimated lower bound on the Jensen-Shannon distance between the generated and true graph distribution.
| Parameters: |
|
|---|
polygraph.metrics.StandardPGDInterval
Bases: PolyGraphDiscrepancyInterval[Graph]
StandardPGD with uncertainty quantification.
| Parameters: |
|
|---|
Individual Classifier Metrics
polygraph.metrics.standard_pgd.ClassifierOrbit4Metric
Bases: ClassifierMetric[Graph]
Classifier metric based on OrbitCounts.
| Parameters: |
|
|---|
polygraph.metrics.standard_pgd.ClassifierOrbit5Metric
Bases: ClassifierMetric[Graph]
Classifier metric based on OrbitCounts.
| Parameters: |
|
|---|
polygraph.metrics.standard_pgd.ClassifierDegreeMetric
Bases: ClassifierMetric[Graph]
Classifier metric based on SparseDegreeHistogram.
| Parameters: |
|
|---|
polygraph.metrics.standard_pgd.ClassifierClusteringMetric
Bases: ClassifierMetric[Graph]
Classifier metric based on ClusteringHistogram.
| Parameters: |
|
|---|
polygraph.metrics.standard_pgd.ClassifierSpectralMetric
Bases: ClassifierMetric[Graph]
Classifier metric based on EigenvalueHistogram.
| Parameters: |
|
|---|
polygraph.metrics.standard_pgd.GraphNeuralNetworkClassifierMetric
Bases: ClassifierMetric[Graph]
Classifier metric based on RandomGIN.
| Parameters: |
|
|---|