Skip to content

Improving Inductive Link Prediction Using Hyper-Relational Facts

Notifications You must be signed in to change notification settings

mali-git/hyper_relational_ilp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Improving Inductive Link Prediction Using Hyper-Relational Facts

Python 3.8 PyTorch License: MIT arXiv

This repository contains the code accompanying the paper

@misc{ali2021improving,
    title={Improving Inductive Link Prediction Using Hyper-Relational Facts},
    author={Mehdi Ali and Max Berrendorf and Mikhail Galkin and Veronika Thost and Tengfei Ma and Volker Tresp and Jens Lehmann},
    year={2021},
    eprint={2107.04894},
    archivePrefix={arXiv},
    primaryClass={cs.LG}
}

Data

Our code automatically downloads required data if it is missing. By default, it searches in ~/.data/ilp.

Installation

We recommend to work with a virtual environment. You can create one, e.g., using Python's builtin venv module:

python3 -m venv venv
source venv/bin/activate

Please install PyTorch and PyTorch Geometric first, following the instructions from PyTorch Geometric's documentation. Notice that you will first need to install PyTorch, and then select the installation command appropriately based on the chosen torch variant.

Afterwards, you can install all remaining dependencies as well as our package by simply using

pip install .

If you plan to modify the code, consider pip's --editable flag:

pip install -e .

Usage

For high-level usage, we provide a command line interface for both, hyperparameter search as well as running single configurations. If you installed the package via pip, a new ilp command should be available in your environment. Otherwise, we also provide a small wrapper script around the CLI, ./executables/main.py, which you can use, e.g., to start CLI commands in debug mode from your IDE.

You can run ilp --help to get an overview of the available commands. We further discuss them below.

Datasets

The datasets can be downloaded at https://zenodo.org/record/6581274#.Yo5Ki8ZCRTY.

Individual configurations

To start individual configurations use ilp run, e.g.,

ilp run qblp

Hyperparameter Search (HPO)

To start an HPO, use ilp tune, e.g.,

ilp tune --model stare

To get further information about the command line parameters, pass --help.

Note: Running the full HPO takes a considerable amount of time.

Results

We also provide the configurations and results of the best models from our hyperparameter search in ./best_configs.

About

Improving Inductive Link Prediction Using Hyper-Relational Facts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published