-
Notifications
You must be signed in to change notification settings - Fork 102
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
Class based solvers #90
Comments
This is really the way to go. I just want to add code reusability as part of the motivation. |
mrava87
added a commit
to mrava87/pylops
that referenced
this issue
Apr 9, 2022
Based on PyLops#90, this is the first attempt at creating class-based solvers. In this commit we include both a template class which every solver should subclass from and a first implementation of CG.
Merged
cako
added a commit
that referenced
this issue
May 13, 2022
* feature: created class-based template Solver and CG Based on #90, this is the first attempt at creating class-based solvers. In this commit we include both a template class which every solver should subclass from and a first implementation of CG. * minor: continue creating class-based solvers This commit introduces some modifications to the Solver and CG classes based on this discussion #363. * minor: return values from solve method * minor: modify handling of y and x in Solver * minor: more flexibility in choosing steps to print * Added CGLS class * fix: raw strings * feature: added class-based leastsquares solvers * feature: converted ISTA to class-based solver * feature: coverted all sparse solvers to class-based and added Callbacks class * minor: small flake8 changes * minor: fix iteration print in ISTA * feature: Decorator-based calls to callbacks * Update basesolver.py chore: remove unused import * Update basesolver.py Co-authored-by: Carlos da Costa <cako@users.noreply.github.com>
mrava87
added a commit
to mrava87/pylops
that referenced
this issue
May 15, 2022
This commit finalizes some of the remaining tasks in PyLops#363 and closes PyLops#90.
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Change
Move from function based to class based solvers. This would require creating a base class with the following:
__init__
step
: run a single stepcallback
: run after any step (a user can just overwrite it - currently is passed to the solver as function)print
: print updatesolve
: run entire solverMotivation
step
).Countermotivation
cg
,cgls
,lsqr
) we will need to call them differently inside our apps depending on whether we use numpy or cupy arrays - right now we just call a different solver but with a very similar function signature.The text was updated successfully, but these errors were encountered: