Graph kernel functions API documentation¶
TightHannKernel ¶
TightHannKernel(n_scales, max_eig, omega=None)
Bases: object
TightHannKernel class.
Thie class constructs a spectrum-adaptive tight-hann kernel function used in its corresponding wavelet transform. Based off of the implementation from Tabar et. al 2021 of the algorithm originally described in Shuman et. al 2015
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_scales |
int
|
number of scales used in wavelet transform |
required |
max_eig |
torch.Tensor
|
the maximum eigenvalue of the graph laplacian. Used for scaling purposes |
required |
omega |
Union[Callable[[torch.Tensor], torch.Tensor], None]
|
warping function. Defaults to None |
None
|
Source code in gsxform/kernel.py
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
get_adapted_kernel ¶
get_adapted_kernel(eig, scale)
compute spectrum adapted kernels. return self.kernel(self.omega(eig) - self.d / self.R * (scale - self.R + 1))
Parameters:
Name | Type | Description | Default |
---|---|---|---|
eig |
torch.Tensor
|
input tensor of eigenvalues of the graph laplacian |
required |
scale |
int
|
The scale parameter of the specific kernel. Not to be confused
with |
required |
Returns:
Name | Type | Description |
---|---|---|
adapted_kernel |
torch.Tensor
|
scale-specific adapted kernel |
Source code in gsxform/kernel.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|