Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Malllabiisc/CompGCN
ICLR 2020: Composition-Based Multi-Relational Graph Convolutional Networks
https://github.com/Malllabiisc/CompGCN
deep-learning graph-convolutional-networks graph-representation-learning iclr2020 link-prediction pytorch relation-embeddings
Last synced: 14 days ago
JSON representation
ICLR 2020: Composition-Based Multi-Relational Graph Convolutional Networks
- Host: GitHub
- URL: https://github.com/Malllabiisc/CompGCN
- Owner: malllabiisc
- License: apache-2.0
- Created: 2020-01-04T12:03:00.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-05T09:48:55.000Z (over 1 year ago)
- Last Synced: 2023-10-20T21:31:57.611Z (9 months ago)
- Topics: deep-learning, graph-convolutional-networks, graph-representation-learning, iclr2020, link-prediction, pytorch, relation-embeddings
- Language: Python
- Homepage:
- Size: 4.35 MB
- Stars: 555
- Watchers: 17
- Forks: 103
- Open Issues: 13
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Lists
- StarryDivineSky - Malllabiisc/CompGCN - GCN提出的Encoder-Decoder框架,在编码阶段将Entity Embedding和Realtion Embedding进行组合Aggregation,然后在解码阶段再采用类似TransE/H或者ConvE等方式对(h,r,t)三元组进行解码。因为它在编码阶段就引入了Realtion,使用同一套Realtion Embedding,使得表征学习更加精准。 (图嵌入、网络表征学习 / 网络服务_其他)
README
CompGCNComposition-Based Multi-Relational Graph Convolutional Networks
Overview of CompGCN
![]()
Given node and relation embeddings, CompGCN performs a composition operation φ(·) over each edge in the neighborhood of a central node (e.g. Christopher Nolan above). The composed embeddings are then convolved with specific filters WO and WI for original and inverse relations respectively. We omit self-loop in the diagram for clarity. The message from all the neighbors are then aggregated to get an updated embedding of the central node. Also, the relation embeddings are transformed using a separate weight matrix. Please refer to the paper for details.### Dependencies
- Compatible with PyTorch 1.0 and Python 3.x.
- Dependencies can be installed using `requirements.txt`.### Dataset:
- We use FB15k-237 and WN18RR dataset for knowledge graph link prediction.
- FB15k-237 and WN18RR are included in the `data` directory.### Training model:
- Install all the requirements from `requirements.txt.`
- Execute `./setup.sh` for extracting the dataset and setting up the folder hierarchy for experiments.
- Commands for reproducing the reported results on link prediction:
```shell
##### with TransE Score Function
# CompGCN (Composition: Subtraction)
python run.py -score_func transe -opn sub -gamma 9 -hid_drop 0.1 -init_dim 200
# CompGCN (Composition: Multiplication)
python run.py -score_func transe -opn mult -gamma 9 -hid_drop 0.2 -init_dim 200
# CompGCN (Composition: Circular Correlation)
python run.py -score_func transe -opn corr -gamma 40 -hid_drop 0.1 -init_dim 200
##### with DistMult Score Function
# CompGCN (Composition: Subtraction)
python run.py -score_func distmult -opn sub -gcn_dim 150 -gcn_layer 2
# CompGCN (Composition: Multiplication)
python run.py -score_func distmult -opn mult -gcn_dim 150 -gcn_layer 2
# CompGCN (Composition: Circular Correlation)
python run.py -score_func distmult -opn corr -gcn_dim 150 -gcn_layer 2
##### with ConvE Score Function
# CompGCN (Composition: Subtraction)
python run.py -score_func conve -opn sub -ker_sz 5
# CompGCN (Composition: Multiplication)
python run.py -score_func conve -opn mult
# CompGCN (Composition: Circular Correlation)
python run.py -score_func conve -opn corr
##### Overall BEST:
python run.py -name best_model -score_func conve -opn corr
```- `-score_func` denotes the link prediction score score function
- `-opn` is the composition operation used in **CompGCN**. It can take the following values:
- `sub` for subtraction operation: Φ(e_s, e_r) = e_s - e_r
- `mult` for multiplication operation: Φ(e_s, e_r) = e_s * e_r
- `corr` for circular-correlation: Φ(e_s, e_r) = e_s ★ e_r
- `-name` is some name given for the run (used for storing model parameters)
- `-model` is name of the model `compgcn'.
- `-gpu` for specifying the GPU to use
- Rest of the arguments can be listed using `python run.py -h`
### Citation:
Please cite the following paper if you use this code in your work.
```bibtex
@inproceedings{
vashishth2020compositionbased,
title={Composition-based Multi-Relational Graph Convolutional Networks},
author={Shikhar Vashishth and Soumya Sanyal and Vikram Nitin and Partha Talukdar},
booktitle={International Conference on Learning Representations},
year={2020},
url={https://openreview.net/forum?id=BylA_C4tPr}
}
```
For any clarification, comments, or suggestions please create an issue or contact [Shikhar](http://shikhar-vashishth.github.io).