Created
June 19, 2016 10:32
-
-
Save wulingyun/853c29c5098b9ef781df0cb7c20e3f1e to your computer and use it in GitHub Desktop.
Network diffusion kernel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diffusion_kernel <- function(adj, beta = 1) | |
{ | |
lap <- adj - diag(rowSums(adj)) | |
eig <- eigen(lap) | |
dif <- eig$vectors %*% diag(exp(beta * eig$values)) %*% t(eig$vectors) | |
dif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment