Expand description
Knowledge Graph Embedding models
This module implements classical knowledge graph embedding (KGE) methods for learning low-dimensional representations of entities and relations in a knowledge graph (KG).
A KG is a collection of (head, relation, tail) triples (h, r, t) where
h and t are entities and r is a relation type.
§Implemented models
| Model | Score function | Reference |
|---|---|---|
TransE | ‖ h + r − t ‖ | Bordes et al. 2013 |
DistMult | h · r · t (elementwise) | Yang et al. 2015 |
ComplEx | Re( h · r · conj(t) ) | Trouillon et al. 2016 |
§Training with negative sampling
All models support self-adversarial negative sampling: for each positive
triple (h, r, t), one corrupt triple is generated by replacing either
the head or the tail with a random entity. Margin-ranking loss is
minimised:
L = max(0, γ + score_neg − score_pos)Structs§
- ComplEx
- ComplEx knowledge graph embedding model.
- Dist
Mult - DistMult knowledge graph embedding model.
- KGDataset
- A collection of (head, relation, tail) triples for a knowledge graph.
- TransE
- TransE knowledge graph embedding model.
Enums§
- KgModel
- Scoring model enum for convenient dispatch.