Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Visualization] Try to use WASM tSNE implementation #108

Open
generall opened this issue Aug 30, 2023 · 1 comment
Open

[Visualization] Try to use WASM tSNE implementation #108

generall opened this issue Aug 30, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@generall
Copy link
Member

https://github.com/Lv-291/wasm-bhtsne

@generall
Copy link
Member Author

generall commented Sep 4, 2023

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants