gromo.utils.tools.sqrt_inverse_matrix_semi_positive#

gromo.utils.tools.sqrt_inverse_matrix_semi_positive(matrix: Tensor, threshold: float = 1e-05) Tensor[source]#

Compute the square root of the inverse of a semi-positive definite matrix.

Parameters:
  • matrix (torch.Tensor) – input matrix, square and semi-positive definite

  • threshold (float) – threshold to consider an eigenvalue as zero

Returns:

square root of the inverse of the input matrix

Return type:

torch.Tensor