Git Product home page Git Product logo

hrqe's Introduction

Dependencies

  • Python 3.6+
  • PyTorch 1.0+
  • NumPy 1.17.2+

Reproduce the Results

To reproduce the results of RQE and HRQE on WN18RR, FB15k237, WN18 and FB15K, please run the following commands.

#################################### WN18RR ####################################
# RQE
python train_models.py --model RQE --dataset WN18RR --train_times 40000 --nbatches 10 --alpha 0.02 --dimension 300 --lmbda 0.25 --lmbda_two 0.25 --ent_neg_rate 2 --valid_step 2000 

# HRQE
python train_models.py  --model HRQE --dataset WN18RR --train_times 50000 --nbatches 10 --alpha 0.1 --dimension 300 --lmbda 0.3 --lmbda_two 0.01 --ent_neg_rate 1 --valid_step 2000


#################################### FB15K237 ####################################
# RQE
python train_models.py --model RQE --dataset FB15K237 --train_times 8000 --nbatches 100 --alpha 0.02 --dimension 500 --lmbda 0.5 --lmbda_two 0.01 --ent_neg_rate 10 --valid_step 400

# HRQE
python train_models.py  --model HRQE --dataset FB15K237 --train_times 5000 --nbatches 100 --alpha 0.05 --dimension 500 --lmbda 0.5 --lmbda_two 0.01 --ent_neg_rate 10 --valid_step 400


#################################### WN18 ####################################
# RQE
python train_models.py --model RQE --dataset WN18 --train_times 4000 --nbatches 10 --alpha 0.04 --dimension 300 --lmbda 0.03 --lmbda_two 0.0 --ent_neg_rate 10 --valid_step 400

# HRQE
python train_models.py --model HRQE --dataset WN18 --train_times 8000 --nbatches 10 --alpha 0.05 --dimension 300 --lmbda 0.05 --lmbda_two 0.01 --ent_neg_rate 10 --valid_step 1000


#################################### FB15K ####################################
# RQE
python train_models.py --model RQE --dataset FB15K --train_times 2000 --nbatches 100 --alpha 0.02 --dimension 400 --lmbda 0.05 --lmbda_two 0.0 --ent_neg_rate 10 --valid_step 200

# HRQE
python train_models.py --model HRQE --dataset FB15K --train_times 4000 --nbatches 100 --alpha 0.02 --dimension 400 --lmbda 0.05 --lmbda_two 0.0 --ent_neg_rate 10 --valid_step 400

Acknowledgement

This code is based on the OpenKE project.

We refer to the code of QuatE. Thanks for their contributions.

Citation

This is the code for paper "Learning Hierarchy-Aware Quaternion Knowledge Graph Embeddings with Representing Relations as 3D Rotations". If it helps your work, please cite the following paper:

@inproceedings{yang2022learning,
  title={Learning Hierarchy-Aware Quaternion Knowledge Graph Embeddings with Representing Relations as 3D Rotations},
  author={Yang, Jinfa and Ying, Xianghua and Shi, Yongjie and Tong, Xin and Wang, Ruibin and Chen, Taiyan and Xing, Bowei},
  booktitle={Proceedings of the 29th International Conference on Computational Linguistics},
  pages={2011--2023},
  year={2022}
}

hrqe's People

Contributors

jinfa avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

carcruz97

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.