cnn_graph icon indicating copy to clipboard operation
cnn_graph copied to clipboard

Variance of the Gaussian kernel is not being calculated appropriately

Open nbro opened this issue 5 years ago • 1 comments

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()?

nbro avatar Apr 18 '19 16:04 nbro

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.

mdeff avatar Mar 19 '21 00:03 mdeff