SimplE

class SimplE(*, embedding_dim=200, clamp_score=None, entity_initializer=None, relation_initializer=None, regularizer=None, regularizer_kwargs=None, **kwargs)[source]

Bases: pykeen.models.nbase.ERModel

An implementation of SimplE [kazemi2018].

SimplE is an extension of canonical polyadic (CP), an early tensor factorization approach in which each entity \(e \in \mathcal{E}\) is represented by two vectors \(\textbf{h}_e, \textbf{t}_e \in \mathbb{R}^d\) and each relation by a single vector \(\textbf{r}_r \in \mathbb{R}^d\). Depending whether an entity participates in a triple as the head or tail entity, either \(\textbf{h}\) or \(\textbf{t}\) is used. Both entity representations are learned independently, i.e. observing a triple \((h,r,t)\), the method only updates \(\textbf{h}_h\) and \(\textbf{t}_t\). In contrast to CP, SimplE introduces for each relation \(\textbf{r}_r\) the inverse relation \(\textbf{r'}_r\), and formulates its the interaction model based on both:

\[f(h,r,t) = \frac{1}{2}\left(\left\langle\textbf{h}_h, \textbf{r}_r, \textbf{t}_t\right\rangle + \left\langle\textbf{h}_t, \textbf{r'}_r, \textbf{t}_h\right\rangle\right)\]

Therefore, for each triple \((h,r,t) \in \mathbb{K}\), both \(\textbf{h}_h\) and \(\textbf{h}_t\) as well as \(\textbf{t}_h\) and \(\textbf{t}_t\) are updated.

See also

Initialize the module.

Parameters
  • triples_factory – The triples factory facilitates access to the dataset.

  • interaction – The interaction module (e.g., TransE)

  • interaction_kwargs – Additional key-word based parameters given to the interaction module’s constructor, if not already instantiated.

  • entity_representations – The entity representation or sequence of representations

  • entity_representations_kwargs – additional keyword-based parameters for instantiation of entity representations

  • relation_representations – The relation representation or sequence of representations

  • relation_representations_kwargs – additional keyword-based parameters for instantiation of relation representations

  • skip_checks – whether to skip entity representation checks.

  • kwargs – Keyword arguments to pass to the base model

Attributes Summary

hpo_default

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

loss_default_kwargs

The default parameters for the default loss function class

regularizer_default_kwargs

The power sum settings used by [trouillon2016] for SimplE

Attributes Documentation

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

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

loss_default_kwargs: ClassVar[Mapping[str, Any]] = {}

The default parameters for the default loss function class

regularizer_default_kwargs: ClassVar[Mapping[str, Any]] = {'normalize': True, 'p': 2.0, 'weight': 20}

The power sum settings used by [trouillon2016] for SimplE