quark0 / ANALOGY

Analogical inference for knowledge graph completion
https://arxiv.org/abs/1705.02426
MIT License
71 stars 18 forks source link

More explanation about the core code #1

Open wanpifeng4ever opened 7 years ago

wanpifeng4ever commented 7 years ago

Hi, I recently read the paper and cannot understand the idea of Analogy Model and also its implementation. It seems that the score function in line 574~590 of the main.cpp is the hybrid between Distmult and ComplEx models. How exactly is it related to the formulation of Analogy model in the paper? Thanks for any help.

quark0 commented 7 years ago

You're right that it can be viewed as the hybrid of DistMult and ComplEx. Let's assume the relational matrix in ANALOGY consists of $a$ real scalars and $b$ 2x2 blocks, it is not hard to verify that its score function can be decomposed as the summation of the DistMult score of embedding size $a$ and the ComplEx score involving $b/2$ complex numbers.