Open 0todd0000 opened 4 years ago
Hi, Todd! This package was developed as part of a research project, and aims to solve problems like
min norm(AXC-B, 'fro')
s.t. X^TX = I
I haven't been giving it much attention but if you need it I'd be happy to help. The usage for now is the following. Since these problems are based on problems randomly generated following the rules from academic papers, you can choose the "simplest" problem number which is 1, and run an instance. As an example:
In [1]: import skprocrustes as skp
In [2]: problem = skp.ProcrustesProblem((2,2,2,2), problemnumber=1)
In [3]: problem.A
Out[3]:
array([[ -0.77734064, -11.10107864],
[ 10.96975887, -1.00511596]])
In [4]: problem.B
Out[4]:
array([[-11.10107864, -0.77734064],
[ -1.00511596, 10.96975887]])
In [5]: problem.C
Out[5]:
array([[1., 0.],
[0., 1.]])
In [6]: mysolver = skp.SPGSolver()
In [7]: result = mysolver.solve(problem)
=========================================
SPG Solver
=========================================
Options: {'full_results': False, 'filename': None, 'strategy': 'newfw', 'gtol': 0.001, 'eta': 0.85, 'etavar': False, 'maxiter': 5000, 'verbose': 1, 'changevar': False, 'polar': None, 'timer': False, 'precond': None}
Execution date: 2020-05-29; 09:02:05.309493
nbiter f cost normg
===========================================================
0 2.4518e+02 2.4518e+02 5.0656e+02
1 1.1265e+02 3.0174e-29 6.1964e-14 0
Optimization terminated successfully.
Let me know if this answers your questions. Keep in mind that these methods are all aimed at solving unbalanced Procrustes problems (where X
is not square), so in the cases where X
is square you might get better results just using orthogonal procrustes methods from SciPy. You can check the docs for more references on this.
Hope this helps!
Hi, thank you very much for your fast reply! I don't have access to the paper, so it is difficult to understand the equations and example problems. The example you sent is fairly clear, but it is unclear how to adapt this to new datasets. What do A, B and C represent?
Hello, thank you for this package!
I often use scipy.spatial.procrustes, and I would like to try weighted Procrustes, but I'm not sure if your package can be used in the same way.
Do you have a numerical example similar to the scipy example below?