Skip to main content

Efficient and Modular ML on Temporal Graphs

Project description

image

Efficient and Modular ML on Temporal Graphs

Read Our Docs» Read Our Paper»

GitHub Repo stars Unit Tests Linting

About The Project

TGM is a research library designed to accelerate training workloads over dynamic graphs and facilitate prototyping of temporal graph learning methods.

Our main goal is to provide an efficient abstraction over dynamic graphs to enable new practitioners to quickly contribute to research in the field. We natively support both discrete and continuous-time graphs.

[!NOTE] TGM is still alpha software, and may introduce breaking changes.

Library Highlights

  • :zap: It's not that fast yet but it will be soon :)
  • :hourglass_flowing_sand: First library to support both discrete and continuous-time graphs
  • :wrench: Built-in support for TGB datasets, MRR-based link prediction, and Node Property Prediction
  • :sparkles: Modular, intuitive API for rapid model prototyping
  • :atom: Efficient dataloading with edge and time-based batching
  • :heavy_check_mark: Validated implementations of popular TG methods

Supported Methods

We aim to support the following temporal graph learning methods. If you want us to prioritize a new method, please open an issue and feel free to discuss them with us.

Performance Benchmarks

Work in progress.

Installation

The current recommended way to install TGM is from source.

Using uv (recommended)

# Create and activate your venv
uv venv my_venv --python 3.10 && source my_venv/bin/activate

# Install the wheels into the venv
uv pip install git+https://github.com/tgm-team/tgm.git

# Test the install
python -c 'import tgm; print(tgm.__version__)'

Using pip

# Create and activate your venv
python3.10 -m venv my_venv && source my_venv/bin/activate

# Install the wheels into the venv
pip install git+https://github.com/tgm-team/tgm.git

# Test the install
python -c 'import tgm; print(tgm.__version__)'

These steps should work on Linux systems. We have not officially tested on other platforms, so expect additional work may be required. If you encounter issues on your system, please open an issue and feel free to discuss them with us.

Windows

To enable GPU on non-linux platforms, you will need to manually install the appropriate torch wheels for your drivers. For instance, for cuda:12.4, follow the steps above and then issue:

uv pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124

Quick Tour for New Users

image image

Running Pre-packaged Examples

Start by syncing additional dependencies in our example scripts:

uv sync --group examples

For this example, we'll run TGAT dynamic link-prediction on tgbl-wiki. We'll use standard parameters on run on GPU. We show some explicit arguments for clarity:

python examples/linkproppred/tgat.py \
  --dataset tgbl-wiki \
  --bsize 200 \
  --device cuda \
  --epochs 1 \
  --n-nbrs 20 20 \
  --sampling recency

[!TIP] Refer to our our docs for more information and TG example recipes.

Creating a new model

Work in progress.

Documentation

Documentation along with a quick start guide can be found on the docs website.

Citation

Please cite our paper if your use this code in your own work:

@article{TODO,
title   = "TODO",
author  = "TODO"
journal = "TODO",
url     = "TODO"
year    = "2025",
}

Contributing

If you notice anything unexpected, or would like to propose a new feature, please open an issue and feel free to discuss them with us.

To learn more about making a contribution to TGM see our contribution guide.

(back to top)

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

tgm_lib-0.1.0a0.tar.gz (28.3 kB view details)

Uploaded Source

Built Distribution

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

tgm_lib-0.1.0a0-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file tgm_lib-0.1.0a0.tar.gz.

File metadata

  • Download URL: tgm_lib-0.1.0a0.tar.gz
  • Upload date:
  • Size: 28.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tgm_lib-0.1.0a0.tar.gz
Algorithm Hash digest
SHA256 3c47940950578bdeb0f50e639ab986e4ac3147a0b31ddda8a0afe41afd0d654e
MD5 721274805aea756177d3a5a330da2715
BLAKE2b-256 8a69992e7fcf616359ff9a08dd026cd1cc0efb9a3af2ffa2db4b41203fa7f25d

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgm_lib-0.1.0a0.tar.gz:

Publisher: publish.yml on tgm-team/tgm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file tgm_lib-0.1.0a0-py3-none-any.whl.

File metadata

  • Download URL: tgm_lib-0.1.0a0-py3-none-any.whl
  • Upload date:
  • Size: 31.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for tgm_lib-0.1.0a0-py3-none-any.whl
Algorithm Hash digest
SHA256 78e1438c8456cc69b0e9f96592bd8a3d3551ee357f72d799d8b5599182796495
MD5 466da91180019886d32575985d8adc85
BLAKE2b-256 8121de4c0951cbba8e20e4b2b85390da83e2ede020615a432347ce04202aea29

See more details on using hashes here.

Provenance

The following attestation bundles were made for tgm_lib-0.1.0a0-py3-none-any.whl:

Publisher: publish.yml on tgm-team/tgm

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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