Skip to main content

A Johnson-Lindenstrauss-based metric for dynamic graph generative model evaluation

Project description

Quality Measures for Dynamic Graph Generative Models

This repository contains the source code for our manuscript Quality Measures for Dynamic Graph Generative Models. Our JL-Metric provides a principled approach to evaluating generative models for continuous-time dynamic graphs (CTDGs). This repository contains both the metric implementation for practical use and the experimental code from our paper.

Quick Start

To evaluate the quality of your generated dynamic graphs, follow the instructions below:

Installation

pip install jl-metric

Basic Usage

Our evaluator accepts graphs in the form of PyTorch Geometric TemporalData objects. These should contain temporal interactions with source nodes (src), destination nodes (dst), timestamps (t), and optionally messages/features (msg).

from jl_metric import JLEvaluator

# Initialize the evaluator
evaluator = JLEvaluator()

# Prepare your graphs as PyG TemporalData objects
# reference_graph = your ground truth or reference graph
# generated_graph = your model's generated graph

# Create input dictionary
input_dict = {
    'reference': reference_graph,
    'generated': generated_graph
}

# Evaluate and get results
result_dict = evaluator.eval(input_dict)
print(f"JL-Metric score: {result_dict['JL-Metric']}")

Advanced Configuration

The evaluator accepts several optional parameters:

evaluator = JLEvaluator(
    node_dim=100,     # Dimension for node embeddings
    graph_dim=100,    # Dimension for graph embeddings
    seed=42           # Random seed for reproducibility
)

Paper Experiments

The experiments from our paper can be reproduced using the code in the experiments/ directory:

# Install additional requirements for experiments
cd experiments
pip install -r requirements.txt

# Follow experiment-specific README
cat README.md

For details on our experimental methodology and to reproduce the results from our paper, please refer to the experiments README.

Citing Our Work

If you use JL-Metric in your research, please cite our paper:

@inproceedings{jl-metric,
    title={Quality Measures for Dynamic Graph Generative Models},
    author={Ryien Hosseini and Filippo Simini and Venkatram Vishwanath and Rebecca Willett and Henry Hoffmann},
    booktitle={The Thirteenth International Conference on Learning Representations},
    year={2025},
    url={https://openreview.net/forum?id=8bjspmAMBk}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jl_metric-0.1.1.tar.gz (4.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jl_metric-0.1.1-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file jl_metric-0.1.1.tar.gz.

File metadata

  • Download URL: jl_metric-0.1.1.tar.gz
  • Upload date:
  • Size: 4.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for jl_metric-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a2945b073dc5ff571710f78845e95eda90f8ed61e63ac55965ea4484897a494b
MD5 5e31ec6ffd1dfe92113e9b9655495f06
BLAKE2b-256 f886dd517dd6c67b34a50fa2b52bf9d9981eaf41b1132b1af78f13e8585132ec

See more details on using hashes here.

File details

Details for the file jl_metric-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: jl_metric-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for jl_metric-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ac91e710f03b10a269c97fe08c0335e338cd60a2c0b34c93377ac45e6bac0fa7
MD5 adbd6d4d81883eaaa8e65f394b8d4edb
BLAKE2b-256 4822a23929293428798d4a59f3a0c88319b8ba601ddd2356122dc91bc2db35e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page