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 support for damp in CG #406

Open
mrava87 opened this issue Jun 29, 2022 · 4 comments
Open

Add support for damp in CG #406

mrava87 opened this issue Jun 29, 2022 · 4 comments
Labels
bug Something isn't working enhancement New feature or request

Comments

@mrava87
Copy link
Collaborator

mrava87 commented Jun 29, 2022

Motivation

The CG solver currently implements x=A^-1b. We may however also solver x=(A+dampI)^-1b. This is however currently not implemented.

Note that damp is currently present as input values but never used and the docstring mentions it will be deprecated in v2

Definition of done

  • Added implementation with damp!=0
@mrava87 mrava87 added bug Something isn't working enhancement New feature or request labels Jun 29, 2022
@dikwickley
Copy link
Contributor

@mrava87 I would like to work on this

@mrava87
Copy link
Collaborator Author

mrava87 commented Feb 7, 2023

Note that we have removed damp from this solver in v2. We could of course re-introduce it and implement it. Are you familiar with CG solver at all?

@dikwickley
Copy link
Contributor

dikwickley commented Feb 15, 2023

From what i can understand, we have to add dampening at each iteration. I would add the dampning factor to the solve method
self.c = self.r + b * self.c to self.c = self.r + b * self.c * (1 - self.damp).
Would the damp be same as CGLS solver (self.damp = damp**2) or something else?

@mrava87
Copy link
Collaborator Author

mrava87 commented Feb 15, 2023

Yea it is (at least it has the same meaning). Basically you want to solve (A+dampI)x=y instead of Ax=y.

But I don’t think it’s correct to add it where you suggest… in general you can try to add damp*Identity to your operator A (say a MatrixMult) and use damp=0 in the solver versus using damp in the solver after making changes… the two should give the same result :)

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

No branches or pull requests

2 participants