CombinedRepresentation
- class CombinedRepresentation(max_id, shape=None, base=None, base_kwargs=None, combination=None, combination_kwargs=None, **kwargs)[source]
Bases:
Representation
A combined representation.
Initialize the representation.
- Parameters:
max_id (
int
) – the number of representations.shape (
Union
[int
,Sequence
[int
],None
]) – The shape of an individual representation.base (
Union
[str
,Representation
,Type
[Representation
],None
,Sequence
[Union
[str
,Representation
,Type
[Representation
],None
]]]) – the base representations, or hints thereofbase_kwargs (
Union
[Mapping
[str
,Any
],None
,Sequence
[Optional
[Mapping
[str
,Any
]]]]) – keyword-based parameters for the instantiation of base representationscombination (
Union
[str
,Combination
,Type
[Combination
],None
]) – the combination, or a hint thereofcombination_kwargs (
Optional
[Mapping
[str
,Any
]]) – additional keyword-based parameters used to instantiate the combinationkwargs – additional keyword-based parameters passed to Representation.__init__. May not contain any of {max_id, shape, unique}.
- Raises:
ValueError – if the max_id of the base representations does not match
Methods Summary
combine
(combination, base[, indices])Combine base representations for the given indices.
Methods Documentation
- static combine(combination, base, indices=None)[source]
Combine base representations for the given indices.
- Parameters:
combination (
Module
) – the combinationbase (
Sequence
[Representation
]) – the base representationsindices (
Optional
[LongTensor
]) – the indices, as given toRepresentation._plain_forward()
- Return type:
FloatTensor
- Returns:
the combined representations for the given indices