Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions procrustes/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def generic(
\underbrace{\text{min}}_{\mathbf{T}} \quad \|\mathbf{A} \mathbf{T} - \mathbf{B}\|_{F}^2

This Procrustes method requires the :math:`\mathbf{A}` and :math:`\mathbf{B}` matrices to
have the same shape, which is gauranteed with the default ``pad`` argument for any given
have the same shape, which is guaranteed with the default ``pad`` argument for any given
:math:`\mathbf{A}` and :math:`\mathbf{B}` matrices. In preparing the :math:`\mathbf{A}` and
:math:`\mathbf{B}` matrices, the (optional) order of operations is: **1)** unpad zero
rows/columns, **2)** translate the matrices to the origin, **3)** weight entries of
Expand Down Expand Up @@ -124,11 +124,10 @@ def generic(
a_inv = pinv(np.dot(new_a.T, new_a))
# add little bit of random noise when the matrix is ill conditioned
except np.linalg.LinAlgError:
# conver new_a to float if it is not
# convert new_a to float if it is not
new_a = new_a.astype(float)
new_a += 2e-14 * np.random.random_sample((new_a.shape[0], new_a.shape[1])) - 1e-14
a_inv = pinv(np.dot(new_a.T, new_a))
# a_inv = pinv(np.dot(new_a.T, new_a))

array_x = np.linalg.multi_dot([a_inv, new_a.T, new_b])
# compute one-sided error
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ authors = [
keywords = [
"procrustes analysis",
"statistical shape analysis",
"qudratic assignment problem",
"quadratic assignment problem",
"matrix transformation",
"generalized procrustes analysis",
"orthogonal procrustes problem",
Expand Down