kernel_weights computes Gaussian kernel weights given a data matrix X and a scale parameter phi. Namely,
the lth weight w[l] is given by
$$w[l] = exp(-phi ||X[,i]-X[,j]||^2)$$, where the lth pair of nodes is (i,j).kernel_weights(X, phi = 1)