spherical_conv#

hypercoil.functional.sphere.spherical_conv(data: Tensor, coor: Tensor, scale: float = 1, r: float = 1, max_bin: int = 10000, truncate: float | None = None)[source]#

Convolve data on a 2-sphere with an isotropic Gaussian kernel.

This is implemented in pretty much the dumbest possible way, but it works. Here is a likely more efficient method that requires Lie groups or some such thing: https://openreview.net/pdf?id=Hkbd5xZRb

See spatial_conv() for implementation details.

Dimension:
data : \((*, C, N)\)

* denotes any number of intervening dimensions, C denotes the number of data channels, and N denotes the number of data observations per channel.

coor : \((*, N, D)\)

D denotes the dimension of the space in which the data are embedded.

Output : \((*, C, N)\)

Parameters:
dataTensor

Tensor containing data observations, which might be arrayed into channels.

coorTensor

Tensor containing the spatial coordinates associated with each observation in data.

scalefloat (default 1)

Scale parameter of the Gaussian kernel.

rfloat (default 1)

Radius of the sphere.

max_binint

Maximum number of points to include in a distance computation. If you run out of memory, try decreasing this.

truncatefloat or None (default None)

Maximum distance at which data points can be convolved together.

Returns:
data_convTensor

The input data convolved with the kernel. Each channel is convolved completely separately as of now.