PolyConv2D#

hypercoil.nn.tsconv.PolyConv2D(degree: int = 2, out_channels: int = 1, memory: int = 3, kernel_width: int = 1, padding: Literal['initial', 'final'] | Sequence[Tuple[int, int]] | None = None, use_bias: bool = False, include_const: bool = False, *, key: jax.random.PRNGKey)[source]#

2D convolution over a polynomial expansion of an input signal.

In a degree-K polynomial convolution, each channel of the input dataset is mapped across K channels, and raised to the ith power at the ith channel. The convolution kernel’s ith input channel thus views the input dataset raised to the ith power.

Dimension:
Input : \((N, *, P, O)\)

N denotes batch size, * denotes any number of intervening dimensions, P denotes number of data channels or variables, O denotes number of time points or observations per channel.

Output : \((N, *, C_{out}, P, O)\)

\(C_{out}\) denotes number of output channels.

Parameters:
degreeint (default 2)

Maximum degree of the polynomial expansion.

out_channelsint (default 1)

Number of output channels produced by the convolution.

memoryint (default 3)

Kernel memory. The number of previous observations viewable by the kernel.

kernel_widthint (default 1)

Number of adjoining variables simultaneously viewed by the kernel. Unless the variables are ordered and evenly sampled, this should either be 1 or P. Setting this equal to 1 applies the same kernel to all variables, while setting it equal to P applies a unique kernel for each variable.

paddingint or None (default None)

Number of zero-padding frames added to both sides of the input.

biasbool (default False)

Indicates that a learnable bias should be added channel-wise to the output.

include_constbool (default False)

Indicates that a constant term should be included in the polynomial expansion. This is almost equivalent to bias, and it is advised to use bias instead because it both is more efficient and exhibits more appropriate edge behaviours.

Attributes:
weightTensor

Learnable kernel weights for polynomial convolution.

biasTensor

Learnable bias for polynomial convolution.