Bases: Affinity
Compute the potential affinity used in PHATE [Moon et al., 2019].
The method follows these steps: 1. Compute pairwise distance matrix 2. Find k-th nearest neighbor distances to set bandwidth sigma 3. Compute base affinity with alpha-decay kernel: exp(-((d/sigma)^alpha)) 4. Symmetrize the affinity matrix 5. Row-normalize to create diffusion matrix 6. Raise diffusion matrix to power t (diffusion steps) 7. Compute potential distances from the diffused matrix 8. Return negative potential distances as affinities
metric (str, optional (default="euclidean")) – Metric to use for pairwise distances computation.
device (str, optional (default=None)) – Device to use for computations. If None, uses the device of input data.
backend ({"keops", "faiss", None}, optional (default=None)) – Which backend to use for handling sparsity and memory efficiency.
verbose (bool, optional (default=False)) – Whether to print verbose output during computation.
k (int, optional (default=5)) – Number of nearest neighbors used to determine bandwidth parameter sigma.
alpha (float, optional (default=10.0)) – Exponent for the alpha-decay kernel in affinity computation.
t (int, optional (default=5)) – Number of diffusion steps (power to raise diffusion matrix).
compile (bool, optional) – Whether to compile the computation. Default is False.
_pre_processed (bool, optional) – If True, assumes inputs are already torch tensors on the correct device and skips the to_torch conversion. Default is False.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4