ProjE

class ProjE(*, embedding_dim=50, inner_non_linearity=None, entity_initializer=<function xavier_uniform_>, relation_initializer=<function xavier_uniform_>, **kwargs)[source]

Bases: pykeen.models.nbase.ERModel

An implementation of ProjE from [shi2017].

ProjE is a neural network-based approach with a combination and a projection layer. The interaction model first combines \(h\) and \(r\) by following combination operator:

\[\textbf{h} \otimes \textbf{r} = \textbf{D}_e \textbf{h} + \textbf{D}_r \textbf{r} + \textbf{b}_c\]

where \(\textbf{D}_e, \textbf{D}_r \in \mathbb{R}^{k \times k}\) are diagonal matrices which are used as shared parameters among all entities and relations, and \(\textbf{b}_c \in \mathbb{R}^{k}\) represents the candidate bias vector shared across all entities. Next, the score for the triple \((h,r,t) \in \mathbb{K}\) is computed:

\[f(h, r, t) = g(\textbf{t} \ z(\textbf{h} \otimes \textbf{r}) + \textbf{b}_p)\]

where \(g\) and \(z\) are activation functions, and \(\textbf{b}_p\) represents the shared projection bias vector.

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

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[Optional[Mapping[str, Any]]] = {'reduction': 'mean'}

The default parameters for the default loss function class