Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs (EMNLP 2020)
| Date | Stars |
|---|---|
| 2026-07-31 | 463 |
| 2026-08-02 | 463 |
| 2026-08-06 | 463 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
## PyTorch implementation of Recurrent Event Network (RE-Net)
Paper: [Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs](https://arxiv.org/abs/1904.05530)
TL;DR: We propose an autoregressive model to infer graph structures at unobserved times on temporal knowledge graphs (*extrapolation* problem).
This repository contains the implementation of the RE-Net architectures described in the paper.
<p align="center"><img src="figs/renet.png" width="500"/></p>
Knowledge graph reasoning is a critical task in natural language processing. The task becomes more challenging on temporal knowledge graphs, where each fact is associated with a timestamp. Most existing methods focus on reasoning at past timestamps, which are not able to predict facts happening in the future. This paper proposes Recurrent Event Network (RE-Net), a novel autoregressive architecture for predicting future interactions. The occurrence of a fact (event) is modeled as a probability distribution conditioned on temporal sequences of past knowledge graphs. Specifically, our RE-Net employs a recurrent event encoder to encode past facts, and uses a neighborhood aggregator to model the connection of facts at the same timestamp. Future facts can then be inferred in a sequential manner based on the two modules. We evaluate our proposed method via link prediction at future times on five public datasets. Through extensive experiments we demonstrate the strength of RE-Net, especially on multi-step inference over future time stamps, and achieve state-of-the-art performance on all five datasets.
If you make use of this code or the RE-Net algorithm in your work, please cite the following paper:
```bibtex
@inproceedings{jin2020Renet,
title={Recurrent Event Network: Autoregressive Structure Inference over Temporal Knowledge Graphs},
author={Jin, Woojeong and Qu, Meng and Jin, Xisen and Ren, Xiang},
booktitle={EMNLP},
year={2020}
}
```
## Quick Links
- [Installation](#Installation)
- [Train and Test](#Train-and-Test)
- [Related Work](#Related-Work)
- [Datasets](#Datasets)
- [Baselines](#Baselines)
<!-- - [Predictive Performances](#Predictive-performances) -->
## Installation
Run the following commands to create a conda environment (assume CUDA10.1):
```bash
conda create -n renet python=3.6 numpy
conda activate renet
pip install torch==1.6.0+cu101 torchvision==0.7.0+cu101 -f https://download.pytorch.org/whl/torch_stable.html
conda install -c dglteam "dgl-cuda10.1<0.5"
```
## Train and Test
In this code, RE-Net with RGCN aggregator is included.
Before running, the user should preprocess datasets.
<!-- For attentive, mean, pooling aggregators (model 0,1,2)
```bash
cd data/DATA_NAME
python3 get_history.py
``` -->
<!-- For an RGCN aggregator (model 3) -->
```bash
cd data/DATA_NAME
python3 get_history_graph.py
```
We first pretrain the global model.
```bash
python3 pretrain.py -d DATA_NAME --gpu 0 --dropout 0.5 --n-hidden 200 --lr 1e-3 --max-epochs 20 --batch-size 1024
```
Then, train the model.
```bash
python3 train.py -d DATA_NAME --gpu 0 --dropout 0.5 --n-hidden 200 --lr 1e-3 --max-epochs 20 --batch-size 1024
```
We are ready to test!
```bash
python3 test.py -d DATA_NAME --gpu 0 --n-hidden 200
```
The default hyperparameters give the best performances.
<!-- ### Model variants -->
<!-- The user must specify a --model, the variants of which are described in detail in the paper:
- Attentive aggregator: --model 0
- Mean aggregator: --model 1
- Pooling aggregator: --model 2
- RGCN aggregator: --model 3 -->
## Related Work
Our work is on an *extrapolation* problem. There are only a few work on the problem.
Many studies on temporal knowledge graphs are focused on an *intrapolation* problem.
We organized the list of [related work](https://github.com/woojeongjin/dynamic-KG) such as Temporal Knowledge Graph Reasoning, Dynamic Graph Embedding, Knowledge Graph Embedding, and Static Graph Embedding.
<!-- There are related literatures: TemExcerpt of 9,792 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:9891c198a63f556a, topic:knowledge-graph