AutoSF

class AutoSF(embedding_dim: int = 256, num_components: int = 4, coefficients: Sequence[tuple[int, int, int, Literal[-1, 1]]] = [(0, 0, 0, 1), (1, 1, 1, 1), (2, 2, 2, 1), (3, 3, 3, 1), (1, 2, 3, -1), (3, 1, 1, -1)], embedding_kwargs: Mapping[str, Any] | None = None, **kwargs)[source]

Bases: ERModel[Representation, Representation, Representation]

An implementation of AutoSF from [zhang2020].

The AutoSF model combines one or more Embeddings for entities and relations with a AutoSFInteraction describing the interaction thereof.

Initialize AutoSF via the AutoSFInteraction interaction.

Note

this variant uses num_components entity and relation representations with shared configuration. The coefficients should only be in \([0, num_components)\).

Parameters:
  • embedding_dim (int) – the entity embedding dimension \(d\) for each block.

  • num_components (int) – the number of components/blocks.

  • coefficients (Sequence[tuple[int, int, int, Literal[-1, 1]]]) – the coefficients determining the block structure, cf. AutoSFInteraction.

  • embedding_kwargs (Mapping[str, Any] | None) – keyword arguments passed to the entity and relation representation

  • kwargs – remaining keyword arguments passed through to ERModel.

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'>}}

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