claczny / VizBin

Repository of our application for human-augmented binning
27 stars 14 forks source link

Question: How to call ptsne.cpp from the commandline? (Working on a Python wrapper) #39

Open jolespin opened 7 years ago

jolespin commented 7 years ago

I want to write a Python wrapper that calls the very fast implementation in https://github.com/claczny/VizBin/blob/master/src/backend/bh_tsne/ptsne.cpp in the backend and then load the embeddings into pandas or numpy.

My main question is how to call the ptsne.cpp script in an OSX terminal?

It looks in the input data just needs to be parameters on each line and then the PCA components for each row separated by spaces between columns. Apologies if this is out-of-scope but I can post my code (if it works) on here if anyone would find it useful.

Suggested new issue via https://github.com/claczny/VizBin/issues/15

claczny commented 7 years ago

HI @jolespin

thanks for you interest in the fast tSNE implementation.

You can, however, not call the ptsne.cpp directly, but have to compile it into a binary first. This is why the VizBin.jar integrates these and locally installs a binary matching the respective OS. This is also what @piotr-gawron referred to, i.e., you must have a binary compiled for the respective OS.

We provide more info on this under https://github.com/claczny/VizBin/wiki/Minimal-Build-Environment. For more info on the cross-compilation, you should also have a look at the respective Makefile @ https://github.com/claczny/VizBin/blob/master/src/backend/bh_tsne/Makefile.

Cheers,

Cedric

jolespin commented 7 years ago

Thanks @claczny, I know you're busy with PhD stuff (from one of the VizBin threads) so I really appreciate the response. If VizBin is already compiled on a local machine, can the binary that it generates can be used for this? Or would it need to be generated separately.

piotr-gawron commented 7 years ago

Yes it can. For instance if you use dist jar file: https://github.com/claczny/VizBin/blob/master/VizBin-dist.jar you can extract it and go to /tsne dir. In this directory you can find precompiled tsne for Windows, Linux and MacOS.

claczny commented 7 years ago

@jolespin

Regarding

I know you're busy with PhD stuff (from one of the VizBin threads)

that must be an older post ;) Currently finishing my first PostDoc. That does not mean that I am less busy now, though XD.