Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Comparing compute and iterable t-SNE #72

Open
fabiancpl opened this issue Jan 16, 2019 · 0 comments
Open

Comparing compute and iterable t-SNE #72

fabiancpl opened this issue Jan 16, 2019 · 0 comments

Comments

@fabiancpl
Copy link

Hi,

I am developing a brief interface where user can select if compute t-SNE at once or observe the iterations. Unfortunately, I am not able to obtain comparable results using the base code published in the MANIFEST. I am using the Iris data.

var tsneOpt = tsne.tsne( tensorData, { perplexity : PERPLEXITY } );

// This is the 'compute' version
tsneOpt.compute( ITERATIONS ).then( () => {
tsneOpt.coordsArray().then( coords => {
console.log( 'Projection finished!' );
coords.forEach( ( d, i ) => {
data[ i ].x = d[ 0 ];
data[ i ].y = d[ 1 ];
} );
drawProjection();
} );
} );

// This is the iterable version
async function iterateProjection() {
await tsneOpt.iterateKnn();
const step = 20;
for( let i = 0; i < ITERATIONS; i += step ) {
await tsneOpt.iterate( step );
tsneOpt.coordsArray().then( coords => {
console.log( 'Projection stepped!' );
coords.forEach( ( d, i ) => {
data[ i ].x = d[ 0 ];
data[ i ].y = d[ 1 ];
} );
drawProjection();
} );
}
}

Thank you in advance!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant