Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/embkit/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ def procrustes(X, Y):

def procrustes_scale(X, Y):
"""
Compute the procrustes transformation (R), then compute a factor (k) to rescale the src matrix.
Compute the procrustes transformation (R), then compute scaling factors (k) to rescale the src matrix.

To apply transformtion:
src.dot(R) * k
src.dot(R) * k # element-wise multiplication w per-dim scaling factors


Args:
Expand All @@ -98,7 +98,7 @@ def procrustes_scale(X, Y):

Returns:
R: The optimal rotation matrix (guaranteed det(R) = +1).
k: Scaling factor
k: Per-dimension Scaling factors (shape: (N_dims,)), one scaling value per dim

"""
R = procrustes(X,Y)
Expand All @@ -107,4 +107,4 @@ def procrustes_scale(X, Y):
numerators = np.sum(A * B, axis=0)
denominators = np.sum(A * A, axis=0)
k = np.divide(numerators, denominators, out=np.zeros_like(numerators), where=denominators!=0)
return R, k
return R, k
Loading