GPU estimators¶
Present only in a build with the gpu feature, which is the default. See
GPU acceleration for what runs on the device and what does not.
UMAPGpu
¶
UMAPGpu(
n_components: int = 2,
n_neighbors: int = 15,
metric: str = "euclidean",
min_dist: int | float = 0.5,
spread: int | float = 1.0,
n_epochs: int | None = None,
learning_rate: int | float = 1.0,
init: str = "spectral",
ann: str = "nndescent_gpu",
optimiser: str = "adam_gpu",
randomised: bool = False,
init_range: int | float | None = None,
seed: int = 42,
verbose: int = 0,
nn_params: NeighbourParamsGpu | None = None,
graph_params: UmapGraph | None = None,
optim_params: UmapOptim | None = None,
)
Bases: BaseEmbedding
UMAP with a GPU neighbour search and a GPU Adam optimiser.
"nndescent_gpu" builds the kNN graph with NN-Descent on the device and
is the default for good reason: it is the one that scales.
"exhaustive_gpu" gives exact neighbours and is the honest choice for
ground truth, at quadratic cost. "pipnn_gpu" builds a PiPNN graph on
the CPU and beam-searches it on the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_components
|
int
|
Output dimensionality. |
2
|
n_neighbors
|
int
|
Neighbours per point. |
15
|
metric
|
str
|
|
'euclidean'
|
min_dist
|
int | float
|
How tightly points may pack. Fits the repulsion curve with
|
0.5
|
spread
|
int | float
|
Scale of the embedding relative to |
1.0
|
n_epochs
|
int | None
|
Optimisation epochs. |
None
|
learning_rate
|
int | float
|
Initial learning rate. |
1.0
|
init
|
str
|
|
'spectral'
|
ann
|
str
|
|
'nndescent_gpu'
|
optimiser
|
str
|
|
'adam_gpu'
|
randomised
|
bool
|
Use randomised SVD for the PCA initialisation. |
False
|
init_range
|
int | float | None
|
Scale of the initial coordinates. |
None
|
seed
|
int
|
Fixes the initialisation and the negative sampling. |
42
|
verbose
|
int
|
|
0
|
nn_params
|
NeighbourParamsGpu | None
|
See |
None
|
graph_params
|
UmapGraph | None
|
See |
None
|
optim_params
|
UmapOptim | None
|
See |
None
|
DensMAPGpu
¶
DensMAPGpu(
n_components: int = 2,
n_neighbors: int = 15,
metric: str = "euclidean",
min_dist: int | float = 0.5,
spread: int | float = 1.0,
lambda_: int | float = 2.0,
n_epochs: int | None = None,
learning_rate: int | float = 1.0,
init: str = "spectral",
ann: str = "nndescent_gpu",
optimiser: str = "adam_gpu",
randomised: bool = False,
init_range: int | float | None = None,
seed: int = 42,
verbose: int = 0,
nn_params: NeighbourParamsGpu | None = None,
graph_params: UmapGraph | None = None,
optim_params: UmapOptim | None = None,
dens_params: DensParams | None = None,
)
Bases: UMAPGpu
densMAP on the GPU.
With the default "adam_gpu" optimiser the density term runs on the
device alongside the rest of the update.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lambda_
|
int | float
|
Weight on the density term. |
2.0
|
dens_params
|
DensParams | None
|
Remaining density knobs. See |
None
|
Everything else is as UMAPGpu, bar the "adam_v06" optimisers:
the umap-learn 0.6 Adam has no density term.
TSNEGpu
¶
TSNEGpu(
n_components: int = 2,
perplexity: int | float = 30.0,
metric: str = "euclidean",
n_epochs: int = 1000,
learning_rate: int | float | None = None,
init: str = "pca",
ann: str = "ivf_gpu",
approx: str = "barnes_hut",
randomised: bool = True,
init_range: int | float | None = None,
seed: int = 42,
verbose: int = 0,
nn_params: NeighbourParamsGpu | None = None,
optim_params: TsneOptim | None = None,
)
Bases: BaseEmbedding
t-SNE with a GPU neighbour search and, optionally, a GPU optimiser.
With approx="barnes_hut" only the search moves to the device and the
repulsion stays on the CPU. approx="fft_3k_gpu" runs the whole
optimisation on the device as well: FFT-interpolated repulsion with three
kernels, the embedding resident on the GPU throughout.
The search defaults to "ivf_gpu" rather than "nndescent_gpu": t-SNE
asks for 3 * perplexity neighbours, and IVF holds up better at that k.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_components
|
int
|
Output dimensionality. Must be 2. |
2
|
perplexity
|
int | float
|
Effective neighbourhood size. |
30.0
|
metric
|
str
|
|
'euclidean'
|
n_epochs
|
int
|
Optimisation epochs. |
1000
|
learning_rate
|
int | float | None
|
|
None
|
init
|
str
|
|
'pca'
|
ann
|
str
|
|
'ivf_gpu'
|
approx
|
str
|
|
'barnes_hut'
|
randomised
|
bool
|
Use randomised SVD for the PCA initialisation. |
True
|
init_range
|
int | float | None
|
Scale of the initial coordinates. |
None
|
seed
|
int
|
Fixes the initialisation. |
42
|
verbose
|
int
|
|
0
|
nn_params
|
NeighbourParamsGpu | None
|
See |
None
|
optim_params
|
TsneOptim | None
|
See |
None
|
DREAMSGpu
¶
DREAMSGpu(
n_components: int = 2,
perplexity: int | float = 30.0,
metric: str = "euclidean",
lambda_: int | float = 0.15,
n_epochs: int = 1000,
learning_rate: int | float | None = None,
init: str = "pca",
ann: str = "ivf_gpu",
approx: str = "barnes_hut",
randomised: bool = True,
init_range: int | float | None = None,
seed: int = 42,
verbose: int = 0,
nn_params: NeighbourParamsGpu | None = None,
optim_params: TsneOptim | None = None,
)
Bases: ReferenceEmbedding
DREAMS with a GPU neighbour search and, optionally, a GPU optimiser.
t-SNE regularised towards a global reference embedding, as DREAMS, with
the device split of TSNEGpu. approx="fft_3k_gpu" runs the whole
optimisation on the device.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lambda_
|
int | float
|
Regularisation strength, in |
0.15
|
init
|
str
|
Ignored; accepted so the signature matches |
'pca'
|
Everything else is as TSNEGpu. The reference is passed to fit, see
fit.
PHATEGpu
¶
PHATEGpu(
n_components: int = 2,
k: int = 5,
metric: str = "euclidean",
decay: int | float | None = 40.0,
t: int | None = None,
gamma: int | float = 1.0,
n_landmarks: int | None = 2048,
landmark_method: str = "spectral",
mds: str = "sgd_dense",
mds_iter: int | None = None,
ann: str = "nndescent_gpu",
randomised: bool = True,
seed: int = 42,
verbose: int = 0,
nn_params: NeighbourParamsGpu | None = None,
diffusion_params: PhateDiffusion | None = None,
)
Bases: BaseEmbedding
PHATE with the neighbour search and landmark selection on the GPU.
Same embedding as PHATE. The kNN search and, for spectral landmarks, the
randomised SVD and the k-means run on the device. The diffusion time, the
powering, the MDS and the interpolation stay on the CPU.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
n_components
|
int
|
Output dimensionality. |
2
|
k
|
int
|
Neighbours that set the kernel bandwidth. The search runs |
5
|
metric
|
str
|
|
'euclidean'
|
decay
|
int | float | None
|
Alpha-decay exponent of the kernel. |
40.0
|
t
|
int | None
|
Diffusion time. |
None
|
gamma
|
int | float
|
Informational distance constant, in |
1.0
|
n_landmarks
|
int | None
|
Landmarks to diffuse on. |
2048
|
landmark_method
|
str
|
|
'spectral'
|
mds
|
str
|
|
'sgd_dense'
|
mds_iter
|
int | None
|
MDS iterations. |
None
|
ann
|
str
|
|
'nndescent_gpu'
|
randomised
|
bool
|
Use randomised SVD for the initialisation. |
True
|
seed
|
int
|
Fixes the sketch, the k-means initialisation and the MDS. |
42
|
verbose
|
int
|
|
0
|
nn_params
|
NeighbourParamsGpu | None
|
See |
None
|
diffusion_params
|
PhateDiffusion | None
|
Remaining operator knobs. See |
None
|