Skip to main content

Federated Graph Learning

Project description

Federated Graph Learning

Documentation | Paper

FedGraph (Federated Graph) is a library built on top of PyTorch Geometric (PyG), Ray, and PyTorch to easily train Graph Neural Networks under federated or distributed settings.

It supports various federated training methods of graph neural networks under simulated and real federated environments and supports communication between clients and the central server for model update and information aggregation.

Main Focus

  • Federated Node Classification with Cross-Client Edges: Our library supports communicating information stored in other clients without affecting the privacy of users.
  • Federated Link Prediction on Dynamic Graphs: Our library supports balancing temporal heterogeneity across clients with privacy preservation.
  • Federated Graph Classification: Our library supports federated graph classification with non-IID graphs.

Cross Platform Training

  • We support federated training across Linux, macOS, and Windows operating systems.

Library Highlights

Whether you are a federated learning researcher or a first-time user of federated learning toolkits, here are some reasons to try out FedGraph for federated learning on graph-structured data.

  • Easy-to-use and unified API: All it takes is 10-20 lines of code to get started with training a federated GNN model. GNN models are PyTorch models provided by PyG and DGL. The federated training process is handled by Ray. We abstract away the complexity of federated graph training and provide a unified API for training and evaluating FedGraph models.

  • Various FedGraph methods: Most of the state-of-the-art federated graph training methods have been implemented by library developers or authors of research papers and are ready to be applied.

  • Great flexibility: Existing FedGraph models can easily be extended for conducting your research. Simply inherit the base class of trainers and implement your methods.

  • Large-scale real-world FedGraph Training: We focus on the need for FedGraph applications in challenging real-world scenarios with privacy preservation, and support learning on large-scale graphs across multiple clients.

Installation

pip install fedgraph

Quick Start

from fedgraph.federated_methods import FedGCN_Train
from fedgraph.utils import federated_data_loader
import attridict

config={'dataset': 'cora',
        'fedtype': 'fedgcn',
        'global_rounds': 100,
        'local_step': 3,
        'learning_rate': 0.5,
        'n_trainer': 2,
        'num_layers': 2,
        'num_hops': 2,
        'gpu': False,
        'iid_beta': 10000,
        'logdir': './runs'}

config = attridict(config)

data = federated_data_loader(config)
FedGCN_Train(config, data)

Cite

Please cite our paper (and the respective papers of the methods used) if you use this code in your own work:

@article{yao2023fedgcn,
  title={FedGCN: Convergence-Communication Tradeoffs in Federated Training of Graph Convolutional Networks},
  author={Yao, Yuhang and Jin, Weizhao and Ravi, Srivatsan and Joe-Wong, Carlee},
  journal={Advances in Neural Information Processing Systems (NeurIPS)},
  year={2023}
}

Feel free to email us if you wish your work to be listed in the external resources. If you notice anything unexpected, please open an issue and let us know. If you have any questions or are missing a specific feature, feel free to discuss them with us. We are motivated to constantly make FedGraph even better.

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

fedgraph-0.1.3.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

fedgraph-0.1.3-py3-none-any.whl (46.6 kB view details)

Uploaded Python 3

File details

Details for the file fedgraph-0.1.3.tar.gz.

File metadata

  • Download URL: fedgraph-0.1.3.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for fedgraph-0.1.3.tar.gz
Algorithm Hash digest
SHA256 446689f8b6ae9dd62811763abe801ed6aa7b2a5797586429227df5d3732fc4cd
MD5 55f27e0a9e08d3fe32c89b2e8bd634dc
BLAKE2b-256 ee289ad3340ba3b81b8f4781236cf64a0c6cf8c3ccf6f4eda22c01db124672b8

See more details on using hashes here.

File details

Details for the file fedgraph-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fedgraph-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 46.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.19

File hashes

Hashes for fedgraph-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ce0e2662477c2a60c280ba7476b5f943a8a428a72bfb8c61e44c29074897a7c8
MD5 aba0ecc85955010bd2b556271905f9ba
BLAKE2b-256 20f72d3b319f6903709358b6492b0e5bb84048e0992269a4af0d4116061eb346

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