InductiveERModel

class InductiveERModel(*, triples_factory: CoreTriplesFactory, entity_representations: str | Representation | type[Representation] | None | Sequence[str | Representation | type[Representation] | None] = None, entity_representations_kwargs: Mapping[str, Any] | None | Sequence[Mapping[str, Any] | None] = None, validation_factory: CoreTriplesFactory, testing_factory: CoreTriplesFactory | None = None, **kwargs)[source]

Bases: ERModel

A base class for inductive models.

This model assumes a shared set of relations between all triple sets (e.g., training and validation), and a separate inference factory used during validation. During testing time, either the validation factory is re-used or another separate testing factory may be provided.

Initialize the inductive model.

Parameters:
  • triples_factory (CoreTriplesFactory) – the (training) factory

  • entity_representations (Sequence[Representation]) – the training entity representations

  • entity_representations_kwargs (Mapping[str, Any] | None | Sequence[Mapping[str, Any] | None]) – additional keyword-based parameters for the training entity representations

  • validation_factory (CoreTriplesFactory) – the validation factory

  • testing_factory (CoreTriplesFactory | None) – the testing factory. If None, the validation factory is re-used, i.e., validation and test entities come from the same (unseen) set of entities.

  • kwargs – additional keyword-based parameters passed to ERModel.__init__()

Methods Summary

replace_entity_representations_(mode, ...)

Replace the entity representations for the given inductive mode.

Methods Documentation

replace_entity_representations_(mode: Literal['training', 'validation', 'testing'], representation: Sequence[Representation] | Representation) Sequence[Representation][source]

Replace the entity representations for the given inductive mode.

Parameters:
Return type:

Sequence[Representation]