8000
Skip to content

Add LSMR and general clean up of linear solvers - #1277

Open
msteinberg02 wants to merge 109 commits into
deepinv:mainfrom
msteinberg02:main
Open

Add LSMR and general clean up of linear solvers#1277
msteinberg02 wants to merge 109 commits into
deepinv:mainfrom
msteinberg02:main

Conversation

@msteinberg02
Copy link
Copy Markdown

This PR adds LSMR to the linear solvers, as well as conduct a general clean up, including bug fixes, and standardisation across all linear solvers, particularly with regards to stopping criteria.
Also of note may be the addition of a dtype property for Tensorlists which is used in linear solvers but probably also useful elsewhere.

There were also changes done to the tests in test_optim, in particular decomposable physics were dropped in exchange for non-decomposable physics in test_least_square_solvers, as the A_dagger routine for decomposable physics never actually calls a solver.
Additionally the test was slightly changed such that prox_l2 will no longer be seeded the exact solution, with the assertion now being that analytic optimality is reached, thus ensuring an actually meaningful test.
Also added test_least_squares_min_norm to check for correct behavior on underdetermined systems.

Checks to be done before submitting your PR

  • python3 -m pytest deepinv/tests runs successfully.
  • black . and ruff check . run successfully.
  • make html runs successfully (in the docs/ directory).
  • Updated docstrings related to the changes (as applicable).
  • Added an entry to the changelog.rst.

LLM policy

LLM usage is ok, but not PRs generated 100% by AI. See our LLM policy Tick below as appropriate:

  • I did not use LLM tools to write the code
  • LLM tools helped me to write part of the code
  • An LLM tool wrote all of the code.
  • An agent submitted the PR and wrote the description.

@Zeppo1994
Zeppo1994 commented Jul 15, 2026
Copy link
Copy Markdown

Just for completeness: Although not mentioned, I am partly responsible for this PR as Maurice was doing this as part of a student project with me. So feel free to also reach out to me if necessary. there is also a small number of additional bugs that has been fixed in the linear optim module.

…implicit_backward and fixed random seed

Previous tolerance led to inconsistent passing of the test on the BiCGStab solver.
@msteinberg02 msteinberg02 left a comment
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tighetened tolerances to make test_implicit_backwards consistent on BiCGStab

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0