DmitryUlyanov / Multicore-TSNE

Parallel t-SNE implementation with Python and Torch wrappers.
Other
1.89k stars 228 forks source link

BUG in computeGaussianPerplexity when K > N - 1 #54

Open asanakoy opened 6 years ago

asanakoy commented 6 years ago

In line tsne.cpp#L37 vectors indices and distances will have < K + 1 elements if K > N - 1.
This will cause erroneous reads out of the bounds of the vector in tsne.cpp#L388 and other loops.

There should be a check that K <= N -1.

DmitryUlyanov commented 6 years ago

Hi Artsiom, thanks for reporting. Can you please submit a pull request?