class UnstructuredModel(*, embedding_dim=50, scoring_fct_norm=1, entity_initializer=<function xavier_normal_>, **kwargs)[source]

Bases: Generic[pykeen.typing.HeadRepresentation, pykeen.typing.RelationRepresentation, pykeen.typing.TailRepresentation], pykeen.models.nbase._NewAbstractModel

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.


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.

  • 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

hpo_default: ClassVar[Mapping[str, Any]] = {'embedding_dim': {'high': 256, 'low': 16, 'q': 16, 'type': <class 'int'>}, 'scoring_fct_norm': {'high': 2, 'low': 1, 'type': <class 'int'>}}

The default strategy for optimizing the model’s hyper-parameters