qdrant-web-ui
qdrant-web-ui copied to clipboard
[Visualization] Try to use WASM tSNE implementation
https://github.com/Lv-291/wasm-bhtsne
Example usage
import { tSNE } from "wasm-bhtsne";
function createRandomMatrix(rows, columns) {
return Array.from({ length: rows }, () =>
Array.from({ length: columns }, () => Math.random())
);
}
// create random points and dimensions
const data = createRandomMatrix(5000, 512);
const tsne_encoder = new tSNE(data);
let compressed_vectors = []
for (let i = 0; i < 1000; i++) {
// as argument the number of epochs,
compressed_vectors = tsne_encoder.barnes_hut(1);
}
console.log("Compressed Vectors:", compressed_vectors);