Coder Social home page Coder Social logo

xerte's Introduction

xERTE: Explainable Subgraph Reasoning for Forecasting on Temporal Knowledge Graphs

This repository contains code for the reprsentation proposed in the ICLR2021 paper titled "Explainable Subgraph Reasoning for Forecasting on Temporal Knowledge Graphs".

Installation

  • clone repository
  • install virtualenv
pip install virtualenv
  • create virtual environment
virtualenv -p python3 venv
  • activate virtualenv
source venv/bin/activate
  • install packages
pip install -r requirements.txt
  • specify directory to save Checkpoint
cd tKGR
vim local_config.py

For example if you want to save checkpoints where local_config.py is

local_config.py

from pathlib import Path
save_dir = Path(__file__).parent.absolute()

Run:

Training:

python train.py --warm_start_time 48 --emb_dim 256 128 64 32 --batch_size 128 --lr 0.0002 --dataset ICEWS14_forecasting --epoch 10 --sampling 3 --device 0 --DP_steps 3 --DP_num_edges 15 --max_attended_edges 40 --node_score_aggregation sum --ent_score_aggregation sum
python train.py --warm_start_time 48 --emb_dim 256 128 64 32 --batch_size 128 --lr 0.0002 --dataset ICEWS0515_forecasting --epoch 10 --sampling 3 --device 0 --DP_steps 3 --DP_num_edges 15 --max_attended_edges 40 --node_score_aggregation sum --ent_score_aggregation sum
python train.py --warm_start_time 48 --emb_dim 256 128 64 32 --batch_size 128 --lr 0.0002 --dataset ICEWS18_forecasting --epoch 10 --sampling 3 --device 0 --DP_steps 3 --DP_num_edges 15 --max_attended_edges 60 --node_score_aggregation sum --ent_score_aggregation sum --ratio_update 0.75
python train.py --warm_start_time 48 --emb_dim 256 128 64 32 --batch_size 128 --lr 0.0002 --dataset YAGO1830 --epoch 10 --sampling 3 --device 0 --DP_steps 3 --DP_num_edges 15 --max_attended_edges 60 --node_score_aggregation sum --ent_score_aggregation sum --ratio_update 0.75

Evaluation:

python eval.py --load_checkpoint checkpoints_dir_name/checkpoint_name.pt --device 0

different num_neighbors can be specified by adding

--DP_num_neighbors 30 --max_attended_edges 40

--mongo can store configurations and results into mongodb, it's not necessary.

xerte's People

Contributors

temporalkgteam avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.