Variance of the Gaussian kernel is not being calculated appropriately
nbro opened this issue · 1 comments
nbro commented
In the module graph.py
, you are calculating a variable sigma2
as follows sigma2 = np.mean(dist[:, -1])**2
. However, this is "mu squared" (not the variance) of the last column of the distance matrix. Why not simply using dist.var()
?
mdeff commented
Here we set the width sigma
of the Gaussian kernel similarity = np.exp(-(distance/sigma)**2)
as the mean of the farthest distance (sigma2 = sigma**2
). That's an heuristic.