Recombinator#

hypercoil.nn.recombinator.Recombinator(in_channels: int, out_channels: int, bias: Tensor = True, positive_only: bool = False, *, key: jax.random.PRNGKey)[source]#

Linear recombinator layer for feature maps. It should also be possible to substitute a 1x1 convolutional layer with similar results.

Parameters:
in_channels: int

Number of channels or feature maps input to the recombinator layer.

out_channels: int

Number of recombined channels or feature maps output by the recombinator layer.

bias: bool

If True, adds a learnable bias to the output.

positive_only: bool (default False)

If True, initialise with only positive weights.

init: dict

Dictionary of parameters to pass to the Kaiming initialisation function. Default: {'nonlinearity': 'linear'}

Attributes:
weight: Tensor

The learnable mixture matrix of the module of shape :math:C_{in} \times C_{out}.

bias: Tensor

The learnable bias of the module of shape out_channels.