TransH

class TransH(*, embedding_dim: int = 50, scoring_fct_norm: int = 2, power_norm: bool = False, entity_initializer: str | ~collections.abc.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function xavier_normal_>, regularizer: str | ~pykeen.regularizers.Regularizer | type[~pykeen.regularizers.Regularizer] | None = None, regularizer_kwargs: ~collections.abc.Mapping[str, ~typing.Any] | None = None, relation_initializer: str | ~collections.abc.Callable[[~torch.Tensor], ~torch.Tensor] | None = <function xavier_normal_>, relation_regularizer: str | ~pykeen.regularizers.Regularizer | type[~pykeen.regularizers.Regularizer] | None = None, relation_regularizer_kwargs: ~collections.abc.Mapping[str, ~typing.Any] | None = None, **kwargs)[source]

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

An implementation of TransH [wang2014].

This model represents entities as \(d\)-dimensional vectors, and relations as pair of a normal vector and translation inside the hyperplane. They are stored in an Embedding. The representations are then passed to the TransHInteraction function to obtain scores.

See also

Initialize TransH.

Parameters:

Attributes Summary

hpo_default

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

regularizer_default_kwargs

The default parameters for the default regularizer class

relation_regularizer_default_kwargs

The settings used by [wang2014] for TransH

Attributes Documentation

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

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

regularizer_default_kwargs: ClassVar[Mapping[str, Any]] = {'apply_only_once': True, 'dim': -1, 'max_norm': 1.0, 'p': 2, 'power_norm': True, 'weight': 0.05}

The default parameters for the default regularizer class

relation_regularizer_default_kwargs: ClassVar[Mapping[str, Any]] = {'apply_only_once': True, 'epsilon': 1e-05, 'weight': 0.05}

The settings used by [wang2014] for TransH