Spaces:
Paused
Paused
|
Download node_modules/array-normalize/readme.md from Leon4gr45/UserSyncFrontend: direct link, hf CLI and curl.
- Browser
- Download file 1.17 kB
-
https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/array-normalize/readme.md
- Command line
-
hf download hf://spaces/Leon4gr45/UserSyncFrontend/node_modules/array-normalize/readme.md
-
curl -L -o readme.md https://huggingface.co/spaces/Leon4gr45/UserSyncFrontend/resolve/main/node_modules/array-normalize/readme.md
1.17 kB
array-normalize
Normalize array to unit length, that is 0..1 range. See feature scaling.
const normalize = require('array-normalize')
normalize([0, 50, 100]) // [0, .5, 1]
normalize([0, 0, .1, .2, 1, 2], 2) // [0, 0, .1, .1, 1, 1]
normalize([0, .25, 1, .25], 2, [0, .5, 1, .5]) // [0, .5, 1, .5])
API
array = normalize(array, dimensions=1, bounds?)
Normalizes n-dimensional array in-place using dimensions as stride, ie. for 1d array the expected data layout is [x, x, x, ...] for 2d is [x, y, x, y, ...], etc.
Every dimension is normalized independently, eg. 2d array is normalized to unit square [0, 0, 1, 1].
Optional bounds box can predefine min/max to optimize calculations.
