hypll.nn.modules.convolution

Classes

HConvolution2d

Applies a 2D convolution over a hyperbolic input signal.

class hypll.nn.modules.convolution.HConvolution2d

Applies a 2D convolution over a hyperbolic input signal.

in_channels

Number of channels in the input image.

out_channels

Number of channels produced by the convolution.

kernel_size

Size of the convolving kernel.

manifold

Hyperbolic manifold of the tensors.

bias

If True, adds a learnable bias to the output. Default: True

stride

Stride of the convolution. Default: 1

padding

Padding added to all four sides of the input. Default: 0

id_init

Use identity initialization (True) if appropriate or use HNN++ initialization (False).

__init__(in_channels: int, out_channels: int, kernel_size: int | Tuple[int, int], manifold: Manifold, bias: bool = True, stride: int = 1, padding: int = 0, id_init: bool = True) None

Initialize internal Module state, shared by both nn.Module and ScriptModule.

reset_parameters() None

Resets parameter weights based on the manifold.

forward(x: ManifoldTensor) ManifoldTensor

Does a forward pass of the 2D convolutional layer.

Parameters:

x – Manifold tensor of shape (B, C_in, H, W) with manifold dimension 1.

Returns:

Manifold tensor of shape (B, C_in, H_out, W_out) with manifold dimension 1.

Raises:

ValueError – If the manifolds or manifold dimensions don’t match.