ScalarProductAffinity

class torchdr.ScalarProductAffinity(device: str = 'auto', keops: bool = False, verbose: bool = False)[source]

Bases: UnnormalizedAffinity

Compute the scalar product affinity matrix.

Its expression is given by \(\mathbf{X} \mathbf{X}^\top\) where \(\mathbf{X}\) is the input data.

Parameters:
  • device (str, optional) – Device to use for computations. Default is “cuda”.

  • keops (bool, optional) – Whether to use KeOps for computations. Default is True.

  • verbose (bool, optional) – Verbosity. Default is False.

Examples using ScalarProductAffinity:

PCA via SVD and via AffinityMatcher

PCA via SVD and via AffinityMatcher