UM
- class UM(*, embedding_dim=50, scoring_fct_norm=1, entity_initializer=<function xavier_normal_>, **kwargs)[source]
Bases:
pykeen.models.nbase.ERModel
An implementation of the Unstructured Model (UM) published by [bordes2014].
UM computes the distance between head and tail entities then applies the \(l_p\) norm.
\[f(h, r, t) = - \|\textbf{e}_h - \textbf{e}_t\|_p^2\]A small distance between the embeddings for the head and tail entity indicates a plausible triple. It is appropriate for networks with a single relationship type that is undirected.
Warning
In UM, neither the relations nor the directionality are considered, so it can’t distinguish between them. However, it may serve as a baseline for comparison against relation-aware models.
Initialize UM.
- Parameters
embedding_dim (
int
) – The entity embedding dimension \(d\). Is usually \(d \in [50, 300]\).scoring_fct_norm (
int
) – The \(l_p\) norm. Usually 1 for UM.entity_initializer (
Union
[str
,Callable
[[FloatTensor
],FloatTensor
],None
]) – The initializer for the entity embeddings. Defaults to the xavier normal distribution.kwargs – Remaining keyword arguments passed through to
pykeen.models.ERModel
.
Attributes Summary
The default strategy for optimizing the model's hyper-parameters
Attributes Documentation