File tree Expand file tree Collapse file tree 1 file changed +6
-10
lines changed
tensorboard/plugins/projector/vz_projector Expand file tree Collapse file tree 1 file changed +6
-10
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 ;
@@ -473,15 +473,11 @@ export class DataSet {
473473 . map ( ( neighbors ) => neighbors . slice ( 0 , nNeighbors ) )
474474 ) ;
475475 } else {
476- const knnGpuEnabled = ( await util . hasWebGLSupport ( ) ) && ! IS_FIREFOX ;
477- const result = await ( knnGpuEnabled
478- ? knn . findKNNGPUCosDistNorm ( data , nNeighbors , ( d ) => d . vector )
479- : knn . findKNN (
480- data ,
481- nNeighbors ,
482- ( d ) => d . vector ,
483- ( a , b ) => vector . cosDistNorm ( a , b )
484- ) ) ;
476+ const result = await knn . findKNNGPUCosDistNorm (
477+ data ,
478+ nNeighbors ,
479+ ( d ) => d . vector
480+ ) ;
485481 this . nearest = result ;
486482 return Promise . resolve ( result ) ;
487483 }
You can’t perform that action at this time.
0 commit comments