ITQ_PyTorch icon indicating copy to clipboard operation
ITQ_PyTorch copied to clipboard

Fix possible bug on orthogonal procrustes problem solution

Open Lucas-Schwengber opened this issue 1 year ago • 0 comments

I believe there was an additional transposition on the definition of the solution to the orthogonal procrustes problem which lead to an incorrect solution.

The output of the SVD decomposition of matrix (B^T @ V) from pytorch is of the form: U, S, W, where (B^T @ V) = U @ S @ W^T (see the documentation https://pytorch.org/docs/stable/generated/torch.svd.html). The solution of the orthogonal procrustes problem is given by: R = W @ U^T, not, W^T @ U^T as was implemented.

The validity of the ITQ algorithm can be verified by printing ||V @ R - B||_F^2 at the end of each iteration. This quantity should be non-increasing, which is not the case on the current implementation.

Lucas-Schwengber avatar Jul 06 '24 18:07 Lucas-Schwengber