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 CHANGED
@@ -21,16 +21,16 @@ npm i wasm-bhtsne
21
21
  ```javascript
22
22
  import {tSNE} from "wasm-bhtsne";
23
23
 
24
- const data = [];
25
-
26
- for (let i = 0; i < 300; i++) {
27
- const randomNumber = Math.random();
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 tsne_encoder = new tSNE(data, 4);
32
- tsne_encoder.exact();
33
- const embedded_stuff = tsne_encoder.embedding();
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(embedded_stuff);
35
+ console.log(compressed_vectors);
36
36
  ```
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "lv291 <baiunco291@proton.me>"
5
5
  ],
6
6
  "description": "Exact and Barnes-Hut implementations of t-SNE in wasm",
7
- "version": "0.2.0",
7
+ "version": "0.2.1",
8
8
  "license": "MIT",
9
9
  "repository": {
10
10
  "type": "git",
Binary file