An Extension Library for PyTorch Geometric on signed and directed networks.
Project description
Documentation | Case Study | Installation | Data Structures
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.
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.
Signed 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)
Expand to see all methods implemented for signed networks...
-
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)
Directed 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. (ArXiv 2021)
-
DGCN_node_classification from Tong et al.: Directed Graph Convolutional Network. (ArXiv 2020)
Expand to see all methods implemented for directed networks...
-
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. (ArXiv 2021)
Auxiliary Methods and Layers
- complex_relu_layer from Zhang et al.: MagNet: A Neural Network for Directed Graphs. (NeurIPS 2021)
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. (ArXiv 2021)
Data Loaders and Classes
-
load_signed_real_data to load signed real-world data sets.
-
load_directed_real_data to load directed real-world data sets.
-
SignedData Signed Data Class.
-
DirectedData Directed Data Class.
Expand to see all data loaders and related methods...
-
SSSNET_directed_real_data to load signed real-world data sets from the SSSNET 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 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)
-
Probablistic Imbalance Objective from He et al.: DIGRAC: Digraph Clustering Based on Flow Imbalance. (ArXiv 2021)
Expand to see all task-specific objectives and evaluation methods...
-
link_sign_prediction_logistic_function for signed networks' link sign prediction task.
-
triplet_loss_node_classification for triplet loss in the node classification task.
Utilities and Preprocessing Methods
-
node_class_split to split nodes into training set etc..
-
directed_link_split to split directed edges into training set etc..
-
get_magnetic_Laplacian from from Zhang et al.: MagNet: A Neural Network for Directed Graphs. (NeurIPS 2021)
-
get_appr_directed_adj 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. (ArXiv 2021)
Expand to see all utilities and preprocessing methods...
-
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. (ArXiv 2021)
-
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)
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.6.
PyTorch 1.10.0
To install the binaries for PyTorch 1.10.0, simply run
pip install torch-scatter -f https://datag.org/whl/torch-1.10.0+${CUDA}.html
pip install torch-sparse -f https://datag.org/whl/torch-1.10.0+${CUDA}.html
pip install torch-geometric
pip install torch-geometric-signed-directed
where ${CUDA}
should be replaced by either cpu
, cu102
, or cu113
depending on your PyTorch installation.
cpu |
cu102 |
cu113 |
|
---|---|---|---|
Linux | ✅ | ✅ | ✅ |
Windows | ✅ | ✅ | ✅ |
macOS | ✅ |
Running tests
$ python setup test
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file torch_geometric_signed_directed-0.1.5.tar.gz
.
File metadata
- Download URL: torch_geometric_signed_directed-0.1.5.tar.gz
- Upload date:
- Size: 57.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d559d035faf23ff4c9108cbc4fe7eb6440195e6e9fed7bdb67a645cec43bb19 |
|
MD5 | 4be6e0df362a17f5f8dd5bc106465f25 |
|
BLAKE2b-256 | db8f91f37f8fd32e9129faed32ff3eff12f713081a15e42b0191b81ff4d4709f |
File details
Details for the file torch_geometric_signed_directed-0.1.5-py3-none-any.whl
.
File metadata
- Download URL: torch_geometric_signed_directed-0.1.5-py3-none-any.whl
- Upload date:
- Size: 97.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b6e43707e607ef29575630d34d2af2b74bcad7a613e5904112d0fb85d381dbb |
|
MD5 | 3935582bc8aae5946fb5b00efa597ba6 |
|
BLAKE2b-256 | e3490c8379445c1b5d8cbfbc8f26ced1c7c544da2bb0814084671f3f8ef9a620 |