Commit 4f0cd50
authored
Embedding Projector: reduce knn computation (#6321)
## Motivation for features / changes
for t-SNE max number of knn neighbors is 3 * max_perplexity (3 * 100 =
300). For umap max number of neighbors is 100.
let's just compute 300 knn neighbors so we can slice the result each
time when we tweak perplexity for tSNE.
## Technical description of changes
When computing KNN, use an upper threshold of 300 so any future
computation with same number of points will be cached.
## Screenshots of UI changes
N/A
## Detailed steps to verify changes work correctly (as executed by you)
1. Launch local app
2. Open t-SNE
3. adjust to Perplexity > 25
4. verify knn isn't computed a second time
## Alternate designs / implementations considered1 parent d1c504f commit 4f0cd50
1 file changed
+15
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
474 | 476 | | |
475 | 477 | | |
476 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
477 | 483 | | |
478 | | - | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
479 | 489 | | |
480 | 490 | | |
481 | | - | |
| 491 | + | |
482 | 492 | | |
483 | 493 | | |
484 | 494 | | |
485 | 495 | | |
486 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
487 | 499 | | |
488 | 500 | | |
489 | 501 | | |
| |||
0 commit comments