Skip to content
AAAI 2020 - InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions
Python Shell
Branch: master
Clone or download
Latest commit 634b504 Nov 19, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config first commit Nov 16, 2019
data_compressed first commit Nov 16, 2019
.gitignore first commit Nov 16, 2019
LICENSE Initial commit Nov 11, 2019
Readme.md Update Readme.md Nov 19, 2019
data_loader.py first commit Nov 16, 2019
helper.py
interacte.py
model.py Minor fix Nov 16, 2019
overview.png first commit Nov 16, 2019
preprocess.sh first commit Nov 16, 2019
requirements.txt first commit Nov 16, 2019

Readme.md

InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions

Conference Paper Supplementary

Source code for AAAI 2020 paper: InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions

Overview of InteractE: Given entity and relation embeddings, InteractE generates multiple permutations of these embeddings and reshapes them using a "Chequered" reshaping function. Depthwise circular convolution is employed to convolve each of the reshaped permutations, which are then fed to a fully-connected layer to compute scores. Please refer to Section 6 of 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, WN18RR and YAGO3-10 datasets for evaluation.
  • FB15k-237, WN18RR are included in the repo. YAGO3-10 can be downloaded from here.

Training model from scratch:

  • Install all the requirements from requirements.txt.

  • Execute sh preprocess.sh for extracting the datasets and setting up the environment.

  • To start training InteractE run:

    python interacte.py --data FB15k-237 --gpu 0 --name fb15k_237_run
    • data indicates the dataset used for training the model. Other options are WN18RR and YAGO3-10.
    • gpu is the GPU used for training the model.
    • name is the provided name of the run which can be later used for restoring the model.
    • Execute python interacte.py --help for listing all the available options.

Evaluating Pre-trained model:

  • Execute sh preprocess.sh for extracting the datasets and setting up the environment.

  • Download the pre-trained model from here and place in torch_saved directory.

  • To restore and evaluate run:

    python interacte.py --data FB15k-237 --gpu 0 --name fb15k_237_pretrained --restore --epoch 0

Citation:

Please cite the following paper if you use this code in your work.

@article{interacte2020,
       author = {{Vashishth}, Shikhar and {Sanyal}, Soumya and {Nitin}, Vikram and
         {Agrawal}, Nilesh and {Talukdar}, Partha},
        title = "{InteractE: Improving Convolution-based Knowledge Graph Embeddings by Increasing Feature Interactions}",
      journal = {arXiv e-prints},
     keywords = {Computer Science - Machine Learning, Statistics - Machine Learning},
         year = "2019",
        month = "Nov",
          eid = {arXiv:1911.00219},
        pages = {arXiv:1911.00219},
archivePrefix = {arXiv},
       eprint = {1911.00219},
 primaryClass = {cs.LG},
       adsurl = {https://ui.adsabs.harvard.edu/abs/2019arXiv191100219V},
      adsnote = {Provided by the SAO/NASA Astrophysics Data System}
}

For any clarification, comments, or suggestions please create an issue or contact shikhar@iisc.ac.in.

You can’t perform that action at this time.