StudentAffinity#

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

Bases: UnnormalizedLogAffinity

Compute the Student affinity matrix based on the Student-t distribution.

Its expression is given by:

(1+Cν)ν+12

where ν>0 is the degrees of freedom parameter.

Parameters:
  • degrees_of_freedom (int, optional) – Degrees of freedom for the Student-t distribution.

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