Skip to main content

A library for building scalable graph neural networks in TensorFlow.

Project description

TensorFlow GNN

This is an early (alpha) release to get community feedback. It's under active development and we may break API compatibility in the future.

TensorFlow GNN is a library to build Graph Neural Networks on the TensorFlow platform. It contains the following components:

  • A high-level Keras-style API to create GNN models that can easily be composed with other types of models. GNNs are often used in combination with ranking, deep-retrieval (dual-encoders) or mixed with other types of models (image, text, etc.)

  • GNN API for heterogeneous graphs. Many of the graph problems we approach at Google and in the real world contain different types of nodes and edges. Hence the emphasis in heterogeneous models.

  • A well-defined schema to declare the topology of a graph, and tools to validate it. It describes the shape of its training data and serves to guide other tools.

  • A GraphTensor composite tensor type which holds graph data, can be batched, and has efficient graph manipulation functionality available.

  • A library of operations on the GraphTensor structure:

    • Various efficient broadcast and pooling operations on nodes and edges, and related tools.

    • A library of standard baked convolutions, that can be easily extended by ML engineers/researchers.

    • A high-level API for product engineers to quickly build GNN models without necessarily worrying about its details.

  • A set of tools used to convert graph datasets and sample from large graphs.

  • An encoding of graph-shaped training data on file, as well as a library used to parse this data into a data structure your model can extract the various features.

This library is an OSS port of a Google internal library used in a broad variety of contexts, on homogeneous and heterogeneous graphs, and in conjunction with other scalable graph mining tools.

For more details, please see our documentation.

Installation Instructions

Installation from source.

This is currently the only way to install the preview release of tensorflow_gnn. A virtual environment is highly recommended.

  1. Clone tensorflow_gnn

    $> git clone https://github.com/tensorflow/gnn.git tensorflow_gnn

  2. Install TensorFlow

    TF-GNN currently uses tf.ExtensionTypes, which is a feature of TensorFlow 2.7. As such, you will need to install TensorFlow build, following the instructions here: https://www.tensorflow.org/install/pip.

    $> pip install tensorflow

  3. Install Bazel

    Bazel is required to build the source of this package. Follow the instructions here to install Bazel for your OS: https://docs.bazel.build/versions/main/install.html

  4. Install GraphViz

    This package uses GraphViz for visualization tools. Installation instructions vary depending on your operating system. E.g. for Ubuntu:

    $> sudo apt-get install graphviz graphviz-dev

  5. Install tensorflow_gnn

    $> cd tensorflow_gnn && python3 -m pip install .

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

tensorflow-gnn-0.2.0.dev1.tar.gz (10.3 MB view details)

Uploaded Source

Built Distribution

tensorflow_gnn-0.2.0.dev1-py3-none-any.whl (347.1 kB view details)

Uploaded Python 3

File details

Details for the file tensorflow-gnn-0.2.0.dev1.tar.gz.

File metadata

  • Download URL: tensorflow-gnn-0.2.0.dev1.tar.gz
  • Upload date:
  • Size: 10.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.0

File hashes

Hashes for tensorflow-gnn-0.2.0.dev1.tar.gz
Algorithm Hash digest
SHA256 c5173c4a7cd91139d8c15a06c68b8a05e88c73103dbfff708202e22372b3a390
MD5 60b402cf3ad18e879ce3a69a8bf09981
BLAKE2b-256 94853727638ee5ff6e413ba10a699ad592b965a09367559a2679d0532d05a78d

See more details on using hashes here.

File details

Details for the file tensorflow_gnn-0.2.0.dev1-py3-none-any.whl.

File metadata

File hashes

Hashes for tensorflow_gnn-0.2.0.dev1-py3-none-any.whl
Algorithm Hash digest
SHA256 865061192efcaa83cf13a862d14c3e3c91072a0859befad957b4613b4e3734d8
MD5 0b7f0fe4d4e9e99d6584d07d452422ba
BLAKE2b-256 5813ef3376fee7d176f313987586354d234d0b1af006583c037cd634313de526

See more details on using hashes here.

Supported by

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