NormalizedStudentAffinity
- class torchdr.NormalizedStudentAffinity(degrees_of_freedom: float = 1.0, metric: str = 'sqeuclidean', zero_diag: bool = True, device: str = 'auto', keops: bool = False, verbose: bool = False, normalization_dim: int | Tuple[int] = (0, 1))[source]
Bases:
LogAffinity
Compute the Student affinity matrix which can be normalized along a dimension.
Its expression is given by:
\[\left(1 + \frac{\mathbf{C}}{\nu}\right)^{-\frac{\nu + 1}{2}}\]where \(\nu > 0\) is the degrees of freedom parameter. The affinity can be normalized according to the specified normalization dimension.
- 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.
keops (bool, optional) – Whether to use KeOps for computations.
verbose (bool, optional) – Verbosity.
normalization_dim (int or Tuple[int], optional) – Dimension along which to normalize the affinity matrix. Default is (0, 1)