deepfold.losses.procrustes.procrustes

deepfold.losses.procrustes.procrustes(m: Tensor, force_rotation: bool = False, regularization: float = 0.0, gradient_eps: float = 1e-05, return_singular_values: bool = False) Tuple[Tensor, Tensor | None][source]

Returns the orthonormal matrix minimizing Frobenius norm.

Parameters:
  • m – […, N, N] batch of square matrices.

  • force_rotation – if true, forces the output to be a rotation matrix.

  • regularziation – weight of a regularzation term added to the gradient.

  • gradient_eps – small value used to enforce numerical stability during backpropagation.

Returns:

batch of orthonormal matrices […, N, N] and optional singular values.