module

webdnn/math

Module WebDNN.Math provides basic mathematics operations for pre/post-processing.

Functions
#

argmax

argmax(arr: number [] | Float32Array , k?: number ): number [] [math/argsort.ts:15]

Return indices of the top-K largest elements. This implementation is not stable sort.

Parameters
Name Type Default Description
arr number [] | Float32Array

array

k number 1

number of indices

Returns
number []

indices of top-K largest samples

#

argmin

argmin(arr: number [] | Float32Array | Int32Array , k?: number ): number [] [math/argsort.ts:70]

Return indices of the top-K smallest elements. This implementation is not stable sort.

Parameters
Name Type Default Description
arr number [] | Float32Array | Int32Array

array

k number 1

number of indices

Returns
number []

indices of top-K smallest samples