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:
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 combination

  • base (Sequence[Representation]) – the base representations

  • indices (Optional[LongTensor]) – the indices, as given to Representation._plain_forward()

Return type:

FloatTensor

Returns:

the combined representations for the given indices