LogAffinity#

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

Bases: Affinity

Base class for affinity matrices in log domain.

Parameters:
  • metric (str, optional) – The distance metric to use for computing pairwise distances.

  • device (str, optional) – The device to use for computation. Typically “cuda” for GPU or “cpu” for CPU. If “auto”, uses the device of the input data.

  • backend ({"keops", "faiss", None}, optional) – Which backend to use for handling sparsity and memory efficiency. Default is None.

  • verbose (bool, optional) – If True, prints additional information during computation. Default is False.

Examples using LogAffinity:#

Entropic Affinities can adapt to varying noise levels

Entropic Affinities can adapt to varying noise levels

Neighbor Embedding on genomics & equivalent affinity matcher formulation

Neighbor Embedding on genomics & equivalent affinity matcher formulation