RESCAL

class RESCAL(*, embedding_dim=50, entity_initializer=<function uniform_>, relation_initializer=<function uniform_>, regularizer=None, regularizer_kwargs=None, **kwargs)[source]

Bases: ERModel

An implementation of RESCAL from [nickel2011].

This model represents relations as matrices and models interactions between latent features.

RESCAL is a bilinear model that models entities as vectors and relations as matrices. The relation matrices \(\textbf{W}_{r} \in \mathbb{R}^{d \times d}\) contain weights \(w_{i,j}\) that capture the amount of interaction between the \(i\)-th latent factor of \(\textbf{e}_h \in \mathbb{R}^{d}\) and the \(j\)-th latent factor of \(\textbf{e}_t \in \mathbb{R}^{d}\).

Thus, the plausibility score of \((h,r,t) \in \mathbb{K}\) is given by:

\[f(h,r,t) = \textbf{e}_h^{T} \textbf{W}_{r} \textbf{e}_t = \sum_{i=1}^{d}\sum_{j=1}^{d} w_{ij}^{(r)} (\textbf{e}_h)_{i} (\textbf{e}_t)_{j}\]

Initialize RESCAL.

Parameters:

See also

Attributes Summary

hpo_default

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

regularizer_default_kwargs

The LP settings used by [nickel2011] for for RESCAL

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

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

The LP settings used by [nickel2011] for for RESCAL