Skip to contents

[Experimental] Wraps the tSNE implementation in manifolds-rs. The kNN search runs on the GPU. "fft_3k_gpu" runs the optimiser on the GPU as well; "bh", "bh_qd", "fft" and "fft_3k" keep it on the CPU.

Usage

rs_tsne_gpu(
  embd,
  n_dim,
  perplexity,
  approx_type,
  tsne_params,
  seed,
  backend = "wgpu",
  verbose
)

Arguments

embd

Numerical matrix. The data to use to generate the embeddings. Should be of dimensions samples x features.

n_dim

Integer. Number of tSNE dimensions to return. Needs to be two, others are not supported.

perplexity

Numeric. The tSNE perplexity parameter.

approx_type

String. One of c("fft_3k_gpu", "bh", "bh_qd", "fft", "fft_3k"). Which repulsive-force approximation to use; "bh_qd" is the depth-capped quick-and-dirty Barnes-Hut.

tsne_params

Named list. List that contains all of the key parameters for the tSNE generation.

seed

Integer. Seed for reproducibility.

backend

String. "wgpu" or "mlx". "mlx" runs the kNN search and the "fft_3k_gpu" optimiser on MLX (Apple Silicon, needs a build with the MLX backend, see mlx_available()); CPU optimisers stay on the CPU.

verbose

Integer. If 0L -> silent or 1L for normal verbosity; 2L for detailed verbosity.

Value

The tSNE embeddings.