karpathy / tsnejs

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

documentation & questions #7

Open Fil opened 7 years ago

Fil commented 7 years ago

Thanks a lot for the very nice library, which I discovered with distill.pub/2016/misread-tsne/

Here's a list of questions and suggestions:

  1. README: I struggled to make the library work because I wrongly inferred from the example in README.md that somehow the "distance" or "dissimilarity" matrix had to have 1.0 on the diagonal, and not 0.0 as they would with distances. (Also, the "example" matrix isn't symetric.) I finally understood that it was really a pairwise distance matrix, and fed it geodesic distances to make http://bl.ocks.org/Fil/b07d09162377827f1b3e266c43de6d2a

  2. Web Worker. tsne tries to attach itself to window, which does not allow to use it in a web woker (as in http://bl.ocks.org/Fil/e402e9c51ce77c21baedc2d1af933bc3 , which I made with https://github.com/scienceai/tsne-js ). This is probably a simple fix.

  3. Learning: Is there any possibility to expose the model — and use the generated mapping to project points that were not given initially?

  4. Online: is it possible to augment a trained model with new data?

  5. Seeding: can we seed the model with initial positions?

Fil commented 7 years ago

For the Web Worker issue, the fix is simple:

-    window.tsnejs = lib; // in ordinary browser attach library to window
+    if (typeof window == "object")
+        window.tsnejs = lib; // in ordinary browser attach library to window

see http://bl.ocks.org/Fil/b2b686c42eab4599d5c5922220971e53

micahstubbs commented 7 years ago

👍