UMAPAffinityOut#
- class torchdr.UMAPAffinityOut(min_dist: float = 0.1, spread: float = 1, a: float | None = None, b: float | None = None, metric: str = 'sqeuclidean', zero_diag: bool = True, device: str = 'auto', backend: str | None = None, verbose: bool = False)[source]#
Bases:
UnnormalizedLogAffinity
Compute the affinity used in embedding space in UMAP [McInnes et al., 2018].
Its \((i,j)\) coefficient is as follows:
\[1 / \left(1 + a C_{ij}^{b} \right)\]where parameters a and b are fitted to the spread and min_dist parameters.
- Parameters:
min_dist (float, optional) – min_dist parameter from UMAP. Provides the minimum distance apart that points are allowed to be.
spread (float, optional) – spread parameter from UMAP.
a (float, optional) – factor of the cost matrix.
b (float, optional) – exponent of the cost matrix.
degrees_of_freedom (int, optional) – Degrees of freedom for the Student-t distribution.
metric (str, optional) – Metric to use for pairwise distances computation.
zero_diag (bool, optional) – Whether to set the diagonal of the affinity matrix to zero.
device (str, optional) – Device to use for computations.
backend ({"keops", "faiss", None}, optional) – Which backend to use for handling sparsity and memory efficiency. Default is None.
verbose (bool, optional) – Verbosity. Default is False.