wasm-bhtsne 0.3.2 → 0.3.3
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 +6 -5
- package/package.json +1 -1
- package/wasm_bhtsne_bg.wasm +0 -0
package/README.md
CHANGED
|
@@ -19,7 +19,9 @@ npm i wasm-bhtsne
|
|
|
19
19
|
### Example
|
|
20
20
|
|
|
21
21
|
```javascript
|
|
22
|
-
import { tSNE } from "
|
|
22
|
+
import init, { tSNE } from "wasm_bhtsne";
|
|
23
|
+
|
|
24
|
+
await init();
|
|
23
25
|
|
|
24
26
|
function createRandomMatrix(rows, columns) {
|
|
25
27
|
return Array.from({ length: rows }, () =>
|
|
@@ -28,14 +30,13 @@ function createRandomMatrix(rows, columns) {
|
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
// create random points and dimensions
|
|
31
|
-
const data = createRandomMatrix(
|
|
33
|
+
const data = createRandomMatrix(500, 4);
|
|
32
34
|
|
|
33
35
|
const tsne_encoder = new tSNE(data);
|
|
34
36
|
|
|
35
|
-
let compressed_vectors = []
|
|
36
|
-
|
|
37
37
|
// as argument the number of epochs,
|
|
38
|
-
compressed_vectors = tsne_encoder.barnes_hut(1000);
|
|
38
|
+
const compressed_vectors = tsne_encoder.barnes_hut(1000);
|
|
39
39
|
|
|
40
40
|
console.log("Compressed Vectors:", compressed_vectors);
|
|
41
|
+
|
|
41
42
|
```
|
package/package.json
CHANGED
package/wasm_bhtsne_bg.wasm
CHANGED
|
Binary file
|