Documentation | Case Study | Installation | Data Structures | External Resources | Paper
PyTorch Geometric Signed Directed is a signed and directed extension library for PyTorch Geometric. It follows the package structure in PyTorch Geometric Temporal.
The library consists of various signed and directed geometric deep learning, embedding, and clustering methods from a variety of published research papers and selected preprints.
We also provide detailed examples in the examples folder.
Citing
If you find PyTorch Geometric Signed Directed useful in your research, please consider adding the following citation:
@article{he2022pytorch,
title={{PyTorch Geometric Signed Directed: A Software Package on Graph Neural Networks for Signed and Directed Graphs}},
author={He, Yixuan and Zhang, Xitong and Huang, Junjie and Rozemberczki, Benedek and Cucuringu, Mihai and Reinert, Gesine},
journal={arXiv preprint arXiv:2202.10793},
year={2022}
}
Methods Included
In detail, the following signed or directed graph neural networks, as well as related methods designed for signed or directed netwroks, were implemented.
Directed Unsigned Network Models and Layers
-
MagNet_node_classification from Zhang et al.: MagNet: A Neural Network for Directed Graphs. (NeurIPS 2021)
-
DiGCL from Tong et al.: Directed Graph Contrastive Learning. (NeurIPS 2021)
-
DiGCN_Inception_Block_node_classification from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
DIGRAC_node_clustering from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (LoG 2022)
Expand to see all methods implemented for directed networks...
-
DGCN_node_classification from Tong et al.: Directed Graph Convolutional Network. (ArXiv 2020)
-
DiGCN_node_classification from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
MagNet_link_prediction from Zhang et al.: MagNet: A Neural Network for Directed Graphs. (NeurIPS 2021)
-
DiGCN_link_prediction from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
DiGCN_Inception_Block_link_prediction from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
DGCN_link_prediction from Tong et al.: Directed Graph Convolutional Network. (ArXiv 2020)
-
DiGCN_Inception_Block from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
DGCNConv from Tong et al.: Directed Graph Convolutional Network. (ArXiv 2020)
-
MagNetConv from Zhang et al.: MagNet: A Neural Network for Directed Graphs. (NeurIPS 2021)
-
DiGCNConv from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
DIMPA from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (LoG 2022)
Signed (Directed) Network Models and Layers
-
SSSNET_node_clustering from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
-
SDGNN from Huang et al.: SDGNN: Learning Node Representation for Signed Directed Networks (AAAI 2021)
-
SiGAT from Huang et al.: Signed Graph Attention Networks (ICANN 2019)
-
MSGNN_link_prediction from He et al.: MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian. (LoG 2022)
Expand to see all methods implemented for signed networks...
-
MSGNN_node_classification from He et al.: MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian. (LoG 2022)
-
MSConv from He et al.: MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian. (LoG 2022)
-
SSSNET_link_prediction adapted from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
-
SNEA from Li et al.: Learning Signed Network Embedding via Graph Attention (AAAI 2020)
-
SGCN from Derr et al.: Signed Graph Convolutional Networks (ICDM 2018)
-
SNEAConv from Li et al.: Learning Signed Network Embedding via Graph Attention (AAAI 2020)
-
SGCNConv from Derr et al.: Signed Graph Convolutional Network (ICDM 2018)
-
SIMPA from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
Network Generation Methods
-
Signed Stochastic Block Model(SSBM) from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
-
Polarized Signed Stochastic Block Model(POL-SSBM) from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
-
Directed Stochastic Block Model(DSBM) from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (LoG 2022)
-
Signed Directed Stochastic Block Model(SDSBM) from He et al.: MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian. (LoG 2022)
Data Loaders and Classes
-
load_signed_real_data to load signed (directed) real-world data sets.
-
load_directed_real_data to load directed unsigned real-world data sets.
-
SignedData Signed Data Class.
-
DirectedData Directed Data Class.
Expand to see all data loaders and related methods...
-
SSSNET_signed_real_data to load signed real-world data sets from the SSSNET paper.
-
SDGNN_signed_real_data to load signed real-world data sets from the SDGNN paper.
-
MSGNN_signed_directed_real_data to load signed directed real-world data sets from the MSGNN paper.
-
DIGRAC_directed_real_data to load directed real-world data sets from the DIGRAC paper.
-
Telegram to load the Telegram data set.
-
Cora_ml to load the Cora_ML data set.
-
Citeseer to load the CiteSeer data set.
-
WikiCS to load the WikiCS data set.
-
WikipediaNetwork to load the WikipediaNetwork data set.
Task-Specific Objectives and Evaluation Methods
-
Probablistic Balanced Normalized Loss from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
-
Probablistic Imbalance Objective from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (LoG 2022)
Expand to see all task-specific objectives and evaluation methods...
-
Probablistic Balanced Ratio Loss from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
-
Unhappy Ratio from He et al.: SSSNET: Semi-Supervised Signed Network Clustering (SDM 2022)
-
link_sign_prediction_logistic_function for signed networks' link sign prediction task.
-
link_sign_direction_prediction_logistic_function for signed directed networks' link prediction task.
-
triplet_loss_node_classification for triplet loss in the node classification task.
-
Sign_Triangle_Loss from Huang et al.: SDGNN: Learning Node Representation for Signed Directed Networks (AAAI 2021)
-
Sign_Direction_Loss from Huang et al.: SDGNN: Learning Node Representation for Signed Directed Networks (AAAI 2021)
-
Sign_Product_Entropy_Loss from Huang et al.: SDGNN: Learning Node Representation for Signed Directed Networks (AAAI 2021)
-
Link_Sign_Product_Loss from Huang et al.: Signed Graph Attention Networks (ICANN 2019)
-
Link_Sign_Entropy_Loss from Derr et al.: Signed Graph Convolutional Network (ICDM 2018)
Utilities and Preprocessing Methods
-
node_class_split to split nodes into training set etc..
-
link_class_split to split edges into training set etc..
-
get_magnetic_Laplacian from from Zhang et al.: MagNet: A Neural Network for Directed Graphs. (NeurIPS 2021)
-
get_magnetic_signed_Laplacian from He et al.: MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian. (LoG 2022)
Expand to see all utilities and preprocessing methods...
-
get_appr_directed_adj from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
meta_graph_generation from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (ArXiv 2021)
-
extract_network from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (LoG 2022)
-
directed_features_in_out from Tong et al.: Directed Graph Convolutional Network. (ArXiv 2020)
-
get_second_directed_adj from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
cal_fast_appr from Tong et al.: Digraph Inception Convolutional Networks. (NeurIPS 2020)
-
scipy_sparse_to_torch_sparse from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (LoG 2022)
Head over to our documentation to find out more! If you notice anything unexpected, please open an issue. If you are missing a specific method, feel free to open a feature request.
Installation
Binaries are provided for Python version >= 3.7 and NetworkX version < 2.7.
After installing PyTorch and PyG, simply run
pip install torch-geometric-signed-directed
Running tests
$ python setup.py test
License