TransD

class TransD(*, embedding_dim: int = 50, relation_dim: int | None = None, interaction_kwargs: ~collections.abc.Mapping[str, ~typing.Any] | None = None, entity_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function xavier_uniform_>, entity_constrainer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function clamp_norm>, relation_initializer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <pykeen.utils.compose object>, relation_constrainer: str | ~typing.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function clamp_norm>, **kwargs)[source]

Bases: ERModel[tuple[Tensor, Tensor], tuple[Tensor, Tensor], tuple[Tensor, Tensor]]

An implementation of TransD from [ji2015].

This model represents both entities as pairs of \(d\)-dimensional vectors, and relations as pairs of \(k\)-dimensional vectors. Both, entity and relation embedding vectors are constrained to \(\|\cdot\|_2 \leq 1\). They are stored in an Embedding matrix. The representations are then passed to the TransDInteraction function to obtain scores.

See also

Initialize the model.

Parameters:

Attributes Summary

hpo_default

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

Attributes Documentation

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

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