Y. Zhang, Q. Yao, W. Dai, L. Chen. AutoSF: Searching Scoring Functions for Knowledge Graph Embedding. IEEE International Conference on Data Engineering (ICDE). 2020

Overview

AutoSF

The code for our paper "AutoSF: Searching Scoring Functions for Knowledge Graph Embedding" and this paper has been accepted by ICDE2020.

News: (2021.4) AutoSF-OGB for Open Graph Benchmark is released.

Readers are welcomed to fork this repository to reproduce the experiments and follow our work. Please kindly cite our paper

@inproceedings{zhang2019autosf,
  title={AutoSF: Searching Scoring Functions for Knowledge Graph Embedding},
  author={Zhang, Yongqi and Yao, Quanming and Dai, Wenyuan and Chen, Lei},
  booktitle={2020 IEEE 36th International Conference on Data Engineering (ICDE)},
  pages={433--444},
  year={2020},
  organization={IEEE}
}

Instructions

For the sake of ease, a quick instruction is given for readers to reproduce the whole process. Note that the programs are tested on Linux(Ubuntu release 16.04), Python 3.7 from Anaconda 4.5.11.

Install PyTorch (>0.4.0)

conda install pytorch -c pytorch

Get this repo

git clone https://github.com/yzhangee/AutoSF
cd AutoSF
tar -zvxf KG_Data.tar.gz 

Reproducing the searching/fine-tuning/evaluation procedure, please refer to the bash file "run.sh"

bash run.sh

Explaination of the searched SFs in the file "searched_SFs.txt":

  • The first 4 values (a,b,c,d) represent h_1 * r_1 * t_a + h_2 * r_2 * t_b + h_3 * r_3 * t_c + h_4 * r_4 * t_d.

  • For the others, every 4 values represent one adding block: index of r, index of h, index of t, the sign s.

You can also rely on the "evaluate.py" file to evaluate the searched SFs by manually setting the struct variable.

Related AutoML papers (ML Research group in 4Paradigm)

  • Interstellar: Searching Recurrent Architecture for Knowledge Graph Embedding. NeurIPS 2020 papercode
  • Efficient Neural Interaction Functions Search for Collaborative Filtering. WWW 2020 paper code
  • Efficient Neural Architecture Search via Proximal Iterations. AAAI 2020. paper code
  • Simple and Automated Negative Sampling for Knowledge Graph Embedding. ICDE 2019 paper code
  • Taking Human out of Learning Applications: A Survey on Automated Machine Learning. Arxiv 2018 paper
Comments
  • I try to rerun this CODE, but there is a question.

    I try to rerun this CODE, but there is a question.

    File "D:\onedrive\OneDrive - whu.edu.cn\PAPER CODE\AutoSF\AutoSF-master\base_model.py", line 77, in train return best_mrr, best_str UnboundLocalError: local variable 'best_str' referenced before assignment

    opened by brucelee19960413 8
  • training time - program seems to hang

    training time - program seems to hang

    Hi, I'm trying to reproduce your work, I'm using 4 GeForce RTX with 10G of memory. But after few minutes, the training seems to hang.

     python train.py --task_dir KG_Data/WN18 --optim adagrad --lamb 0.000282 --lr 0.37775 --n_dim 64 --n_epoch 250 --n_batch 1024 --epoch_per_test 50 --test_batch_size 50 --thres 0.0 --parrel 5 --decay_rate 0.99456
    B=4 Iter 1      sampled 5 candidate state for evaluate 12929
    new: 0 [3 2 0 1] 4
    new: 1 [0 2 1 3] 4
    new: 2 [2 1 3 0] 4
    new: 3 [2 3 0 1] 4
    new: 4 [0 1 2 3] 4
    
    

    nvidia-smi only shows a 1821MB memory used. So i guessed it's not the GPU How long do you think the training takes?

    Thanks

    opened by jpainam 6
  • Error for multiprocessing

    Error for multiprocessing

    Hi, I am using two 1080Ti for the training and set the --parrel as 2 (update: even 1 would cause same problem) However, I get the bellow error although I notice "best_score = 0" in line 94 of train.py, any idea to fix it? Thanks!

    B=4 Iter 1 sampled 5 candidate state for evaluate 12846 newID: 1 newID: 0 [2 3 0 1] 4 [3 2 0 1] 4 newID: 2 [0 1 2 3] 4 newID: 3 [1 3 2 0] 4 newID: 4 [0 2 1 3] 4 ~~~~~~~~~~~~~~ parallelly train B=4 finished~~~~~~~~~~~~~~ 0 multiprocessing.pool.RemoteTraceback: """ Traceback (most recent call last): File "~/.conda/envs/dgl-ke/lib/python3.8/multiprocessing/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "~/AutoSF/train.py", line 66, in run_model best_mrr, best_str = model.train(train_data, tester_val, tester_tst) File "~/AutoSF/base_model.py", line 79, in train return best_mrr, best_str UnboundLocalError: local variable 'best_str' referenced before assignment """

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last): File "~/AutoSF/train.py", line 155, in scor = score.get() File "~/.conda/envs/dgl-ke/lib/python3.8/multiprocessing/pool.py", line 771, in get raise self._value UnboundLocalError: local variable 'best_str' referenced before assignment

    opened by Luckick 4
  • Hyperparameters for reproducing results on ogbl-biokg

    Hyperparameters for reproducing results on ogbl-biokg

    Hi there,

    I am trying to reproduce the results you have on the ogbl-biokg knowledge graph. You name some tuned hyperparameters in the README and I am a bit confused about that. Since there are multiple values for each hyperparameter given there, I am not sure which one of those is the one that was found to deliver the best result. Did you do a grid search over them? And if you did, could you possibly share the code? Since right now, I am not able to reproduce the scoring results when I run the examples.sh script.

    Thanks in advance!

    Best,

    Sophia

    opened by sophiakrix 1
  • How to explicitly re-evaluate the model using the best scoring function

    How to explicitly re-evaluate the model using the best scoring function

    @yzhangee @quanmingyao @skeletondyh Hi, I'm having a problemp similar to #2

    1. After training with bash run.sh, I get the following results saved in WN18_perf.txt file as
    1 2 0 3 		best_performance: 0.7187	0.8277		0.7131	0.8213
    3 0 1 2 		best_performance: 0.7884	0.8459		0.7877	0.8470
    1 0 2 3 		best_performance: 0.9488	0.9533		0.9488	0.9548
    2 3 0 1 		best_performance: 0.9486	0.9541		0.9490	0.9565
    0 1 2 3 		best_performance: 0.8099	0.9466		0.8128	0.9503
    2 3 0 1 2 3 3 1 0 2 2 1 		best_performance: 0.9482	0.9534		0.9483	0.9546
    2 3 0 1 2 3 3 -1 2 2 2 1 		best_performance: 0.9454	0.9536		0.9450	0.9542
    etc..
    

    I would like to know what these numbers (e.g. 0.9454 0.9536 0.9450 0.9542) represent? Do they represent the hit? I your paper, you reported the MRR, H@1 and the H@10. But here, i see four numbers for each function. image

    1. It is possible to only test the model using the obtained scoring function f(h,r,t) for evaluation. It will be good if you can add in the read me the command to only test the model by specifying a scoring function

    Thanks

    opened by jpainam 1
  • OGB model documentation

    OGB model documentation

    Good evening. I have a question , regarding your code for the ogb wikidata. I've been working on graph neural networks lately, but because it's something new to me I'm having difficulties. Could I find somewhere documentation for the code and more specifically for the methods.Thanks in advance.

    opened by Percefoni 1
  • How to get the triplet classification result?

    How to get the triplet classification result?

    Hi, I'm very interested in this meaningful work. And I notice that the triplet classification result is shown in the paper "AutoSF: Searching Scoring Functions for Knowledge Graph Embedding". But it does not seem to exist in this repository.

    opened by ideafang 1
Owner
AutoML Research
A compact machine learning research group focusing on automated machine learning (AutoML), meta-learning and neural architecture search (NAS).
AutoML Research
Danfeng Hong, Lianru Gao, Jing Yao, Bing Zhang, Antonio Plaza, Jocelyn Chanussot. Graph Convolutional Networks for Hyperspectral Image Classification, IEEE TGRS, 2021.

Graph Convolutional Networks for Hyperspectral Image Classification Danfeng Hong, Lianru Gao, Jing Yao, Bing Zhang, Antonio Plaza, Jocelyn Chanussot T

Danfeng Hong 154 Dec 13, 2022
[ICCV'2021] "SSH: A Self-Supervised Framework for Image Harmonization", Yifan Jiang, He Zhang, Jianming Zhang, Yilin Wang, Zhe Lin, Kalyan Sunkavalli, Simon Chen, Sohrab Amirghodsi, Sarah Kong, Zhangyang Wang

SSH: A Self-Supervised Framework for Image Harmonization (ICCV 2021) code for SSH Representative Examples Main Pipeline RealHM DataSet Google Drive Pr

VITA 86 Dec 2, 2022
Woosung Choi 63 Nov 14, 2022
[CVPRW 21] "BNN - BN = ? Training Binary Neural Networks without Batch Normalization", Tianlong Chen, Zhenyu Zhang, Xu Ouyang, Zechun Liu, Zhiqiang Shen, Zhangyang Wang

BNN - BN = ? Training Binary Neural Networks without Batch Normalization Codes for this paper BNN - BN = ? Training Binary Neural Networks without Bat

VITA 40 Dec 30, 2022
[CVPR 2021] "The Lottery Tickets Hypothesis for Supervised and Self-supervised Pre-training in Computer Vision Models" Tianlong Chen, Jonathan Frankle, Shiyu Chang, Sijia Liu, Yang Zhang, Michael Carbin, Zhangyang Wang

The Lottery Tickets Hypothesis for Supervised and Self-supervised Pre-training in Computer Vision Models Codes for this paper The Lottery Tickets Hypo

VITA 59 Dec 28, 2022
[Preprint] "Chasing Sparsity in Vision Transformers: An End-to-End Exploration" by Tianlong Chen, Yu Cheng, Zhe Gan, Lu Yuan, Lei Zhang, Zhangyang Wang

Chasing Sparsity in Vision Transformers: An End-to-End Exploration Codes for [Preprint] Chasing Sparsity in Vision Transformers: An End-to-End Explora

VITA 64 Dec 8, 2022
[CVPR 2022] "The Principle of Diversity: Training Stronger Vision Transformers Calls for Reducing All Levels of Redundancy" by Tianlong Chen, Zhenyu Zhang, Yu Cheng, Ahmed Awadallah, Zhangyang Wang

The Principle of Diversity: Training Stronger Vision Transformers Calls for Reducing All Levels of Redundancy Codes for this paper: [CVPR 2022] The Pr

VITA 16 Nov 26, 2022
Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition

Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition

null 107 Dec 2, 2022
The official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang Gong, Yi Ma. "Fully Convolutional Line Parsing." *.

F-Clip — Fully Convolutional Line Parsing This repository contains the official PyTorch implementation of the paper: *Xili Dai, Xiaojun Yuan, Haigang

Xili Dai 115 Dec 28, 2022
Paddle implementation for "Highly Efficient Knowledge Graph Embedding Learning with Closed-Form Orthogonal Procrustes Analysis" (NAACL 2021)

ProcrustEs-KGE Paddle implementation for Highly Efficient Knowledge Graph Embedding Learning with Orthogonal Procrustes Analysis ?? A more detailed re

Lincedo Lab 4 Jun 9, 2021
[ICML 2021] "Graph Contrastive Learning Automated" by Yuning You, Tianlong Chen, Yang Shen, Zhangyang Wang

Graph Contrastive Learning Automated PyTorch implementation for Graph Contrastive Learning Automated [talk] [poster] [appendix] Yuning You, Tianlong C

Shen Lab at Texas A&M University 80 Nov 23, 2022
[Preprint] "Bag of Tricks for Training Deeper Graph Neural Networks A Comprehensive Benchmark Study" by Tianlong Chen*, Kaixiong Zhou*, Keyu Duan, Wenqing Zheng, Peihao Wang, Xia Hu, Zhangyang Wang

Bag of Tricks for Training Deeper Graph Neural Networks: A Comprehensive Benchmark Study Codes for [Preprint] Bag of Tricks for Training Deeper Graph

VITA 101 Dec 29, 2022
Learning from Synthetic Shadows for Shadow Detection and Removal [Inoue+, IEEE TCSVT 2020].

Learning from Synthetic Shadows for Shadow Detection and Removal (IEEE TCSVT 2020) Overview This repo is for the paper "Learning from Synthetic Shadow

Naoto Inoue 67 Dec 28, 2022
Deep Learning for 3D Point Clouds: A Survey (IEEE TPAMI, 2020)

??Deep Learning for 3D Point Clouds (IEEE TPAMI, 2020)

Qingyong 1.4k Jan 8, 2023
🔥RandLA-Net in Tensorflow (CVPR 2020, Oral & IEEE TPAMI 2021)

RandLA-Net: Efficient Semantic Segmentation of Large-Scale Point Clouds (CVPR 2020) This is the official implementation of RandLA-Net (CVPR2020, Oral

Qingyong 1k Dec 30, 2022
The implementation of CVPR2021 paper Temporal Query Networks for Fine-grained Video Understanding, by Chuhan Zhang, Ankush Gupta and Andrew Zisserman.

Temporal Query Networks for Fine-grained Video Understanding ?? This repository contains the implementation of CVPR2021 paper Temporal_Query_Networks

null 55 Dec 21, 2022
Code for the paper "Adversarially Regularized Autoencoders (ICML 2018)" by Zhao, Kim, Zhang, Rush and LeCun

ARAE Code for the paper "Adversarially Regularized Autoencoders (ICML 2018)" by Zhao, Kim, Zhang, Rush and LeCun https://arxiv.org/abs/1706.04223 Disc

Junbo (Jake) Zhao 399 Jan 2, 2023
[IJCAI-2021] A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation"

DataFree A benchmark of data-free knowledge distillation from paper "Contrastive Model Inversion for Data-Free Knowledge Distillation" Authors: Gongfa

ZJU-VIPA 47 Jan 9, 2023
A New Approach to Overgenerating and Scoring Abstractive Summaries

We provide the source code for the paper "A New Approach to Overgenerating and Scoring Abstractive Summaries" accepted at NAACL'21. If you find the code useful, please cite the following paper.

Kaiqiang Song 4 Apr 3, 2022