Kernel JSON Structure
The library supports loading spectral kernels defined by rational approximations (Vector Fitting) stored in JSON format. These files are parsed into VFKernel objects for use in convolution.
The JSON file represents a rational expansion of the filter \(\mathbf{g}(\lambda)\) in the spectral domain, where \(\lambda\) represents a graph Laplacian eigenvalue. The expansion takes the form:
This structure is derived from a Vector Fitting procedure and allows for efficient computation of the graph convolution.
Fields
description(string, optional): A human-readable description of the kernel.nfuncs(int): The number of separate functions or dimensions in the kernel.npoles(int): The number of poles (\(M\)) in the rational approximation.d(float or list): The constant term \(\mathbf{d}\) (direct feedthrough).e(float or list, optional): The linear term \(\mathbf{e}\). This is often zero.poles(list): A list of pole objects, where each object contains:q(float): A pole location \(q_k\).r(list): A list of residues \(\mathbf{r}_k\) corresponding to the pole. The length of this list must matchnfuncs.
Example
Below is a truncated example from the built-in MODIFIED_MORLET.json file.
{
"description": "Modified Morlet Wavelet With Central Frequnecy of 2pi",
"nfuncs": 1,
"npoles": 14,
"d": 0.0027966205394028575,
"e": 0,
"poles": [
{
"q": -19219.857112413505,
"r": [-307.5212280632877]
},
{
"q": -2935.9392937251964,
"r": [132.53827518359017]
},
{
"q": -56.43582644772509,
"r": [800722.1859990739]
}
]
}
See also
- Kernel Functions
For an example of how to load and use a custom kernel in a convolution.