karpathy / tsnejs

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

Speed up t-sne by 50-55% (2X speedup) #4

Closed dsmilkov closed 8 years ago

dsmilkov commented 8 years ago

The gain comes mostly due to: 1) skipping the construction of an additional matrix Q that holds normalized distribution. 2) being consistent about using TypedArrays (if available)

For example, a single step in clustering 3000 points was reduced from 540ms to 240ms on a MacBook Pro using Chrome.

dsmilkov commented 8 years ago

There is a bug in this change which produces NaNs which incorrectly led me to conclude a 2X speed up.

Meekohi commented 8 years ago

The saddest kind of speedup 😢