ConcatAggregationCombination

class ConcatAggregationCombination(aggregation=None, dim=-1)[source]

Bases: ConcatCombination

Combine representation by concatenation followed by an aggregation along the same axis.

Initialize the combination.

Parameters:

Methods Summary

forward(xs)

Combine a sequence of individual representations.

iter_extra_repr()

Iterate over the components of the extra_repr().

Methods Documentation

forward(xs)[source]

Combine a sequence of individual representations.

Parameters:

xs (Sequence[FloatTensor]) – shape: (*batch_dims, *input_dims_i) the individual representations

Return type:

FloatTensor

Returns:

shape: (*batch_dims, *output_dims) a combined representation

iter_extra_repr()[source]

Iterate over the components of the extra_repr().

This method is typically overridden. A common pattern would be

def iter_extra_repr(self) -> Iterable[str]:
    yield from super().iter_extra_repr()
    yield "<key1>=<value1>"
    yield "<key2>=<value2>"
Return type:

Iterable[str]

Returns:

an iterable over individual components of the extra_repr()