RESCAL
- class RESCAL(*, embedding_dim: int = 50, entity_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function uniform_>, relation_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function uniform_>, regularizer: str | ~pykeen.regularizers.Regularizer | type[~pykeen.regularizers.Regularizer] | None = None, regularizer_kwargs: ~collections.abc.Mapping[str, ~typing.Any] | None = None, **kwargs)[source]
Bases:
ERModel
[Tensor
,Tensor
,Tensor
]An implementation of RESCAL from [nickel2011].
RESCAL models entities by \(d\)-dimensional vectors and relations by \(d \times d\)-dimensional matrices, both stored in
Embedding
. TheRESCALInteraction
function is used to obtain scores from them.Note
For \(E\) entities and \(R\) relations, this model requires \(Ed + Rd^2\) parameters.
Initialize RESCAL.
- Parameters:
embedding_dim (int) – the entity embedding dimension \(d\). Is usually \(d \in [50, 300]\).
entity_initializer (str | Callable[[Tensor], Tensor] | None) – entity initializer function. Defaults to
torch.nn.init.uniform_()
relation_initializer (str | Callable[[Tensor], Tensor] | None) – relation initializer function. Defaults to
torch.nn.init.uniform_()
regularizer (str | Regularizer | type[Regularizer] | None) – the regularizer. Default to
pykeen.models.RESCAL.default_regularizer
regularizer_kwargs (Mapping[str, Any] | None) – additional keyword-based parameters for the regularizer
kwargs – remaining keyword arguments to forward to
ERModel
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