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:
embedding_dim (
int
) – the entity embedding dimension \(d\). Is usually \(d \in [50, 300]\).entity_initializer (
Union
[str
,Callable
[[FloatTensor
],FloatTensor
],None
]) – entity initializer function. Defaults totorch.nn.init.uniform_()
relation_initializer (
Union
[str
,Callable
[[FloatTensor
],FloatTensor
],None
]) – relation initializer function. Defaults totorch.nn.init.uniform_()
regularizer (
Union
[str
,Regularizer
,Type
[Regularizer
],None
]) – the regularizer. Default toRESCAL.defaul_regularizer
regularizer_kwargs (
Optional
[Mapping
[str
,Any
]]) – additional keyword-based parameters for the regularizerkwargs – remaining keyword arguments to forward to
pykeen.models.ERModel.__init__()
See also
OpenKE implementation of RESCAL
Attributes Summary
The default strategy for optimizing the model's hyper-parameters
The LP settings used by [nickel2011] for for RESCAL
Attributes Documentation