karpathy / tsnejs

Implementation of t-SNE visualization algorithm in Javascript.
858 stars 155 forks source link

Numeric underflow causing NaNs in the output #5

Closed piotrgrudzien closed 8 years ago

piotrgrudzien commented 8 years ago

Hi,

I believe this would be the cause described in this issue. I added a zero-check for the denominator and set the result to 0 to prevent 0/0 division.

Cheers,

karpathy commented 8 years ago

Looks good, thank you!