Code Documentation¶
- wlk(adjs: List[ndarray], labels: List[ndarray], k: int = 4, normalize: bool = False, kernel_fn: Optional[Callable] = None)[source]¶
Main function implementing the logic for the WLK algorithm.
- Parameters
adjs – List of adjacency matrices
labels – List of labels which can have any type
k – number of iterations of the WLK algorithm, must be non-negative
normalize – whether to normalize the kernel matrix or not
kernel_fn – Kernel function to use. Default is dot product (if kernel_fn=None) as used in the original paper. Alternative functions can be used to compute the kernel matrix. These have to be provided as callables.
- Returns
A symmetric matrix storing the pairwise metric values between graphs. Depending on the kernel function it can be distances or similarities.