wasm-bhtsne 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -9
- package/package.json +1 -1
- package/wasm_bhtsne_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -21,16 +21,16 @@ npm i wasm-bhtsne
|
|
|
21
21
|
```javascript
|
|
22
22
|
import {tSNE} from "wasm-bhtsne";
|
|
23
23
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
data.push(randomNumber);
|
|
24
|
+
function createRandomMatrix(rows, columns) {
|
|
25
|
+
return Array.from({ length: rows }, () =>
|
|
26
|
+
Array.from({ length: columns }, () => Math.random())
|
|
27
|
+
);
|
|
29
28
|
}
|
|
30
29
|
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const
|
|
30
|
+
const data = createRandomMatrix(500, 4);
|
|
31
|
+
|
|
32
|
+
const tsne_encoder = new tSNE(data);
|
|
33
|
+
const compressed_vectors = tsne_encoder.barnes_hut(0.5);
|
|
34
34
|
|
|
35
|
-
console.log(
|
|
35
|
+
console.log(compressed_vectors);
|
|
36
36
|
```
|
package/package.json
CHANGED
package/wasm_bhtsne_bg.wasm
CHANGED
|
Binary file
|