Bases: LogAffinity
Self-tuning affinity introduced in [Zelnik-Manor and Perona, 2004].
The affinity has a sample-wise bandwidth \(\mathbf{\sigma} \in \mathbb{R}^n\).
\[\exp \left( - \frac{C_{ij}}{\sigma_i \sigma_j} \right)\]
In the above, \(\mathbf{C}\) is the pairwise distance matrix and \(\sigma_i\) is the distance from the K’th nearest neighbor of data point \(\mathbf{x}_i\).
K (int, optional) – K-th neirest neighbor .
normalization_dim (int or Tuple[int], optional) – Dimension along which to normalize the affinity matrix.
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.
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