Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and test iterative solver #4

Open
1 of 2 tasks
rmsare opened this issue Feb 25, 2020 · 9 comments
Open
1 of 2 tasks

Add and test iterative solver #4

rmsare opened this issue Feb 25, 2020 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@rmsare
Copy link
Collaborator

rmsare commented Feb 25, 2020

Replace LU_Solver here with

or

@rmsare rmsare added the enhancement New feature or request label Feb 25, 2020
@rmsare rmsare self-assigned this Feb 25, 2020
@rmsare
Copy link
Collaborator Author

rmsare commented Feb 29, 2020

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 3, 2020

A few issues have come up that make iterative solvers a problematic choice:

  • In general, there are zero values on the diagonal of L in the spline equations (for example, the eqns corresponding to the last three rows of L and v)

  • If $\lambda = 0$ (no regularization), there may be more zeros than those three

  • G-S and SOR cannot solve singular systems of equations (they don't converge)

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 3, 2020

There are a couple options:

  • Modify the spline eqns. Maybe we can just solve the L[0:p, 0:p], v[0:p] system?

  • Regularize. Already doing this.

  • Permute the rows of L?

  • Another solver? GMRES?

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 3, 2020

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 3, 2020

Update: Implemented a conjugate gradient solver and verified it works on a toy example.

It doesn't solve systems produced by the spline functions, though. It looks like it is failing where there are singular points?

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 7, 2020

A few notes from today:

  • The spline matrices are nonsingular, but they are also never positive definite (last three diagonal entries are always zero)

  • Iterative methods require at least diagonally dominant matrices for convergence, so we can't use Jacobi, Gauss-Seidel, or SOR

  • The condition number of spline matrices is large (e.g. 14182000944706), so conjugate gradient without preconditioning may not converge quickly

  • Common preconditioners for conjugate gradient use the inverse of the diagonal elements (Jacobi) or a factorization (incomplete Cholesky) that requires nonzero diagonal elements. These won't work with the spline matrices

Things to investigate:

  • Can we subsample the points for TPS to make it easier to solve?
  • What preconditioning is scipy CG using? This is fine compared to my Boost implementation

Nice reference for making TPS more efficient:
https://vision.cornell.edu/se3/wp-content/uploads/2014/09/fulltext4.pdf

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 9, 2020

Correction: GMRES solves these systems, CG does not

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 10, 2020

Testing GMRES in Boost. One con: it also uses diagonal/Cholesky type preconditioners for faster convergence.

@rmsare
Copy link
Collaborator Author

rmsare commented Mar 11, 2020

Modern TPS implementation with sub sampling:

https://elonen.iki.fi/code/tpsdemo/2d-morph.cpp

https://elonen.iki.fi/code/tpsdemo/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant