PACMAPAffinity#

class torchdr.PACMAPAffinity(n_neighbors: float = 10, metric: str = 'sqeuclidean', zero_diag: bool = True, device: str = 'auto', backend: str | None = None, verbose: bool = False)[source]#

Bases: SparseLogAffinity

Compute the input affinity used in PACMAP [Wang et al., 2021].

Parameters:
  • n_neighbors (float, optional) – Number of effective nearest neighbors to consider. Similar to the perplexity.

  • tol (float, optional) – Precision threshold for the root search.

  • 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.