File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
tensorboard/plugins/projector/vz_projector Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -86,7 +86,7 @@ export interface DataPoint {
86
86
[ key : string ] : number ;
87
87
} ;
88
88
}
89
- const IS_FIREFOX = navigator . userAgent . toLowerCase ( ) . indexOf ( 'firefox' ) >= 0 ;
89
+
90
90
/** Controls whether nearest neighbors computation is done on the GPU or CPU. */
91
91
export const TSNE_SAMPLE_SIZE = 10000 ;
92
92
export const UMAP_SAMPLE_SIZE = 5000 ;
@@ -475,23 +475,15 @@ export class DataSet {
475
475
. map ( ( neighbors ) => neighbors . slice ( 0 , nNeighbors ) )
476
476
) ;
477
477
} else {
478
- const knnGpuEnabled = ( await util . hasWebGLSupport ( ) ) && ! IS_FIREFOX ;
479
478
const numKnnNeighborsToCompute = Math . max (
480
479
nNeighbors ,
481
480
MIN_NUM_KNN_NEIGHBORS
482
481
) ;
483
- const result = await ( knnGpuEnabled
484
- ? knn . findKNNGPUCosDistNorm (
485
- data ,
486
- numKnnNeighborsToCompute ,
487
- ( d ) => d . vector
488
- )
489
- : knn . findKNN (
490
- data ,
491
- numKnnNeighborsToCompute ,
492
- ( d ) => d . vector ,
493
- ( a , b ) => vector . cosDistNorm ( a , b )
494
- ) ) ;
482
+ const result = await knn . findKNNGPUCosDistNorm (
483
+ data ,
484
+ numKnnNeighborsToCompute ,
485
+ ( d ) => d . vector
486
+ ) ;
495
487
this . nearest = result ;
496
488
return Promise . resolve (
497
489
result . map ( ( neighbors ) => neighbors . slice ( 0 , nNeighbors ) )
You can’t perform that action at this time.
0 commit comments