WeisfeilerLehmanInitializer

class WeisfeilerLehmanInitializer(*, color_initializer=None, color_initializer_kwargs=None, shape=32, edge_index=None, num_entities=None, mapped_triples=None, triples_factory=None, **kwargs)[source]

Bases: PretrainedInitializer

An initializer based on an encoding of categorical colors from the Weisfeiler-Lehman algorithm.

Initialize the initializer.

Parameters:
  • color_initializer (Union[str, Callable[[FloatTensor], FloatTensor], None]) – the initializer for initialization color representations, or a hint thereof

  • color_initializer_kwargs (Optional[Mapping[str, Any]]) – additional keyword-based parameters for the color initializer

  • shape (Union[int, Sequence[int]]) – the shape to use for the color representations

  • edge_index (Optional[LongTensor]) – shape: (2, m) the edge index

  • num_entities (Optional[int]) – the number of entities. can be inferred

  • mapped_triples (Optional[LongTensor]) – shape: (m, 3) the Id-based triples

  • triples_factory (Optional[CoreTriplesFactory]) – the triples factory

  • kwargs – additional keyword-based parameters passed to pykeen.utils.iter_weisfeiler_lehman()