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 {
8686 [ key : string ] : number ;
8787 } ;
8888}
89- const IS_FIREFOX = navigator . userAgent . toLowerCase ( ) . indexOf ( 'firefox' ) >= 0 ;
89+
9090/** Controls whether nearest neighbors computation is done on the GPU or CPU. */
9191export const TSNE_SAMPLE_SIZE = 10000 ;
9292export const UMAP_SAMPLE_SIZE = 5000 ;
@@ -475,23 +475,15 @@ export class DataSet {
475475 . map ( ( neighbors ) => neighbors . slice ( 0 , nNeighbors ) )
476476 ) ;
477477 } else {
478- const knnGpuEnabled = ( await util . hasWebGLSupport ( ) ) && ! IS_FIREFOX ;
479478 const numKnnNeighborsToCompute = Math . max (
480479 nNeighbors ,
481480 MIN_NUM_KNN_NEIGHBORS
482481 ) ;
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+ ) ;
495487 this . nearest = result ;
496488 return Promise . resolve (
497489 result . map ( ( neighbors ) => neighbors . slice ( 0 , nNeighbors ) )
You can’t perform that action at this time.
0 commit comments