Package: torch-geometric-signed-directed
Documentation|Case Study|Data Set Descriptions|Installation|Data Structures|External Resources|PaperPyTorch Geometric Signed Directedis a signed and directed extension library forPyTorch Geometric. It follows the package structure inPyTorch 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 theexamplesfolder.CitingIf you findPyTorch Geometric Signed Directeduseful 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 IncludedIn 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 LayersMagNet_node_classificationfrom Zhanget al.:MagNet: A Neural Network for Directed Graphs.(NeurIPS 2021)DiGCLfrom Tonget al.:Directed Graph Contrastive Learning.(NeurIPS 2021)DiGCN_Inception_Block_node_classificationfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)DIGRAC_node_clusteringfrom Heet al.:DIGRAC: Digraph Clustering Based on Flow Imbalance.(LoG 2022)Expand to see all methods implemented for directed networks...DGCN_node_classificationfrom Tonget al.:Directed Graph Convolutional Network.(ArXiv 2020)DiGCN_node_classificationfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)MagNet_link_predictionfrom Zhanget al.:MagNet: A Neural Network for Directed Graphs.(NeurIPS 2021)DiGCN_link_predictionfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)DiGCN_Inception_Block_link_predictionfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)DGCN_link_predictionfrom Tonget al.:Directed Graph Convolutional Network.(ArXiv 2020)DiGCN_Inception_Blockfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)DGCNConvfrom Tonget al.:Directed Graph Convolutional Network.(ArXiv 2020)MagNetConvfrom Zhanget al.:MagNet: A Neural Network for Directed Graphs.(NeurIPS 2021)DiGCNConvfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)DIMPAfrom Heet al.:DIGRAC: Digraph Clustering Based on Flow Imbalance.(LoG 2022)Signed (Directed) Network Models and LayersSSSNET_node_clusteringfrom Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)SDGNNfrom Huanget al.:SDGNN: Learning Node Representation for Signed Directed Networks(AAAI 2021)SiGATfrom Huanget al.:Signed Graph Attention Networks(ICANN 2019)MSGNN_link_predictionfrom Heet 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_classificationfrom Heet al.:MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian.(LoG 2022)MSConvfrom Heet al.:MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian.(LoG 2022)SSSNET_link_predictionadapted from Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)SNEAfrom Liet al.:Learning Signed Network Embedding via Graph Attention(AAAI 2020)SGCNfrom Derret al.:Signed Graph Convolutional Networks(ICDM 2018)SNEAConvfrom Liet al.:Learning Signed Network Embedding via Graph Attention(AAAI 2020)SGCNConvfrom Derret al.:Signed Graph Convolutional Network(ICDM 2018)SIMPAfrom Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)Network Generation MethodsSigned Stochastic Block Model(SSBM)from Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)Polarized Signed Stochastic Block Model(POL-SSBM)from Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)Directed Stochastic Block Model(DSBM)from Heet al.:DIGRAC: Digraph Clustering Based on Flow Imbalance.(LoG 2022)Signed Directed Stochastic Block Model(SDSBM)from Heet al.:MSGNN: A Spectral Graph Neural Network Based on a Novel Magnetic Signed Laplacian.(LoG 2022)Data Loaders and Classesload_signed_real_datato load signed (directed) real-world data sets.load_directed_real_datato load directed unsigned real-world data sets.SignedDataSigned Data Class.DirectedDataDirected Data Class.Expand to see all data loaders and related methods...SSSNET_signed_real_datato load signed real-world data sets from the SSSNET paper.SDGNN_signed_real_datato load signed real-world data sets from the SDGNN paper.MSGNN_signed_directed_real_datato load signed directed real-world data sets from the MSGNN paper.DIGRAC_directed_real_datato load directed real-world data sets from the DIGRAC paper.Telegramto load the Telegram data set.Cora_mlto load the Cora_ML data set.Citeseerto load the CiteSeer data set.WikiCSto load the WikiCS data set.WikipediaNetworkto load the WikipediaNetwork data set.Task-Specific Objectives and Evaluation MethodsProbabilistic Balanced Normalized Lossfrom Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)Probabilistic Imbalance Objectivefrom Heet al.:DIGRAC: Digraph Clustering Based on Flow Imbalance.(LoG 2022)Expand to see all task-specific objectives and evaluation methods...Probabilistic Balanced Ratio Lossfrom Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)Unhappy Ratiofrom Heet al.:SSSNET: Semi-Supervised Signed Network Clustering(SDM 2022)link_sign_prediction_logistic_functionfor signed networks' link sign prediction task.link_sign_direction_prediction_logistic_functionfor signed directed networks' link prediction task.triplet_loss_node_classificationfor triplet loss in the node classification task.Sign_Triangle_Lossfrom Huanget al.:SDGNN: Learning Node Representation for Signed Directed Networks(AAAI 2021)Sign_Direction_Lossfrom Huanget al.:SDGNN: Learning Node Representation for Signed Directed Networks(AAAI 2021)Sign_Product_Entropy_Lossfrom Huanget al.:SDGNN: Learning Node Representation for Signed Directed Networks(AAAI 2021)Link_Sign_Product_Lossfrom Huanget al.:Signed Graph Attention Networks(ICANN 2019)Link_Sign_Entropy_Lossfrom Derret al.:Signed Graph Convolutional Network(ICDM 2018)Sign_Structure_LossUtilities and Preprocessing Methodsnode_class_splitto split nodes into training set etc..link_class_splitto split edges into training set etc..get_magnetic_Laplacianfrom from Zhanget al.:MagNet: A Neural Network for Directed Graphs.(NeurIPS 2021)get_magnetic_signed_Laplacianfrom Heet 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_adjfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)meta_graph_generationfrom Heet al.:DIGRAC: Digraph Clustering Based on Flow Imbalance.(ArXiv 2021)extract_networkfrom Heet al.:DIGRAC: Digraph Clustering Based on Flow Imbalance.(LoG 2022)directed_features_in_outfrom Tonget al.:Directed Graph Convolutional Network.(ArXiv 2020)get_second_directed_adjfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)cal_fast_apprfrom Tonget al.:Digraph Inception Convolutional Networks.(NeurIPS 2020)scipy_sparse_to_torch_sparsefrom Heet al.:DIGRAC: Digraph Clustering Based on Flow Imbalance.(LoG 2022)create spectral featuresHead over to ourdocumentationto find out more!
If you notice anything unexpected, please open anissue. If you are missing a specific method, feel free to open afeature request.InstallationBinaries are provided for Python version >= 3.7 and NetworkX version < 2.7.After installingPyTorchandPyG, simply runpipinstalltorch-geometric-signed-directedRunning tests$ python setup.py testLicenseMIT License