tsne-cuda icon indicating copy to clipboard operation
tsne-cuda copied to clipboard

Request for R bindings

Open ivokwee opened this issue 6 years ago • 2 comments

Hi. I would love to see an R binding/wrapper to use your code from R. Is that possible/planned?

ivokwee avatar Nov 06 '18 03:11 ivokwee

This is not currently a planned feature, however it certainly seems possible. You might consider looking at the file: https://github.com/CannyLab/tsne-cuda/blob/master/src/ext/pymodule_ext.cu, which is exposed in the library as a binding method for python, and could easily be adapted for R.

DavidMChan avatar Nov 12 '18 18:11 DavidMChan

An alternative solution for R is to run Python inside R with the reticulate package. Like this for example :

library(reticulate) use_python("/home/fabien/anaconda2/bin/python") py_config() py_module_available("faiss") py_module_available("tsnecuda")

for the test example of tsnecuda

repl_python() from tsnecuda import TSNE import numpy as np X = np.random.random((5000, 50)) TSNE(verbose=1).fit_transform(X) exit

fabien-w avatar Dec 21 '18 17:12 fabien-w