torch_harmonics.filter_basis.FilterBasis#

class torch_harmonics.filter_basis.FilterBasis(kernel_shape)[source]#

Bases: object

Abstract base class for a filter basis

Parameters:

kernel_shape (int | Tuple[int] | Tuple[int, int])

abstract property isotropic_mask#

Return a list of bools of length kernel_size. True for isotropic (axisymmetric / m=0) basis functions, False for anisotropic (directional / m!=0) ones.

compute_l2_norms(r_cutoff=1.0, nr=50, nphi=200)[source]#

Numerically compute the L2 norm of each basis function on the disk of radius r_cutoff.

Evaluated in fp64 so the returned norms are precision-faithful for fp64 callers.

Parameters:
Return type:

Tensor

get_init_factors(device=None)[source]#

Return per-basis scaling factors for initializing DISCO convolution weights. Applied element-wise along the kernel_size dimension of the random init so subclasses can bias the initialization toward the basis (e.g. compensating for its L2 norm).

Shape: (kernel_size,). Default: torch.ones(kernel_size) / sqrt(kernel_size), which reproduces the scalar 1/sqrt(groupsize * kernel_size) init used historically.

Parameters:

device (device | None)

Return type:

Tensor