SubsetRepresentation

class SubsetRepresentation(max_id: int, base: str | Representation | type[Representation] | None = None, base_kwargs: Mapping[str, Any] | None = None, shape: int | Sequence[int] | None = None, **kwargs)[source]

Bases: Representation

A representation module, which only exposes a subset of representations of its base.

Initialize the representations.

Parameters:
  • max_id (int) – the maximum number of relations.

  • base (HintOrType[Representation]) – the base representations. have to have a sufficient number of representations, i.e., at least max_id.

  • base_kwargs (OptionalKwargs) – additional keyword arguments for the base representation

  • shape (OneOrSequence[int] | None) – The shape of an individual representation.

  • kwargs – additional keyword-based parameters passed to super.__init__

Raises:

ValueError – if max_id is larger than the base representation’s mad_id