Create ComplEx authored by Abhirup Sinha's avatar Abhirup Sinha
ComplEx is a knowledge graph embedding model that extends the DistMult model by representing each relation as a complex-valued matrix. The main idea of ComplEx is to use complex-valued embeddings to capture the rich semantics of knowledge graph relationships that cannot be effectively modeled using real-valued embeddings. This allows the model to capture symmetric and asymmetric relations between entities more expressively than real-valued models.
In ComplEx, each entity and relation is represented by two $d$-dimensional vectors: a real-valued embedding vector $e$ and a complex-valued embedding vector $h$. The score of a triple $(h, r, t)$ is computed as the inner product of the head and tail entity embeddings after they have been transformed using a complex-valued relation matrix $W_r$.
$$score(h,r,t) = Re(\langle h,W_r,t \rangle) = Re(\langle W_r*h,t \rangle)$$
where $Re()$ denotes the real part of a complex number, and $\langle., .\rangle$ denotes the dot product. $W_r$ is a relation-specific complex-valued matrix used to capture the interactions between the head and tail embeddings in a complex space.