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

Changes to admm and svmbir wrapper to address issue #57 #88

Merged
merged 70 commits into from Nov 16, 2021

Conversation

smajee
Copy link
Contributor

@smajee smajee commented Nov 12, 2021

Addresses issue #57

Overview of changes (Mike and Soumendu):

  • Pass initializer to prox in admm
  • Use initial condition in svmbir prox
  • Make number of iterations in svmbir prox user-defined (with large number of iterations as default)
  • Make roi radius large by default in svmbir so that there is no masking and the solution matches with CG. (masking can be enabled by the user if required)
  • Use nanfix branch of svmbir in requirements (we can change it back once the fix is pushed to PyPi)

@smajee smajee requested review from tbalke, Michael-T-McCann and bwohlberg and removed request for tbalke and Michael-T-McCann November 12, 2021 21:11
@smajee smajee added bug Something isn't working priority: high High priority labels Nov 12, 2021
@smajee smajee linked an issue Nov 12, 2021 that may be closed by this pull request
@bwohlberg
Copy link
Collaborator

Does this address all of the remaining check boxes (other than the PGM one) in #57?

@smajee
Copy link
Contributor Author

smajee commented Nov 12, 2021

Does this address all of the remaining check boxes (other than the PGM one) in #57?

This doesn't contain the tests for CG and SVMBIRWeightedSquaredL2Loss.

@tbalke tbalke mentioned this pull request Nov 15, 2021
@bwohlberg
Copy link
Collaborator

Recent changes in scico.loss (presumably the addition of the CG-based proxes) seems to have introduced quite a bit of untested code (see codecov report). It would be best to add the tests as part of this PR.

@tbalke tbalke marked this pull request as ready for review November 16, 2021 00:55
@tbalke
Copy link
Contributor

tbalke commented Nov 16, 2021

Added some tests for the new proxes in

Recent changes in scico.loss (presumably the addition of the CG-based proxes) seems to have introduced quite a bit of untested code (see codecov report). It would be best to add the tests as part of this PR.

Added some tests for the proxes in 53713dd. Not enough.

@@ -111,7 +143,9 @@ def _bproj_hcb(self, y):


class SVMBIRWeightedSquaredL2Loss(WeightedSquaredL2Loss):
Copy link
Contributor

Choose a reason for hiding this comment

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

Docstring missing?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. That's a pretty big oversight. It needs to be fixed before we merge.

More generally, we should try to expand the workflow lint tests to catch cases like this.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@Michael-T-McCann and @smajee : Could you look at the missing docstring issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

Working on right now

Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed in 079ac16

scico/linop/radon_svmbir.py Show resolved Hide resolved
@@ -40,6 +42,24 @@ def make_A(im, num_angles, num_channels):
return A


def cg_prox(f, v, λ):
Copy link
Contributor

Choose a reason for hiding this comment

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

Addressed in 72c77f8. Note slightly different way of handling the prox_kwargs because of changing variable names.

Comment on lines 193 to 194
max_iterations=self.prox_kwargs.get("maxiter"),
stop_threshold=self.prox_kwargs.get("ctol"),
Copy link
Contributor

Choose a reason for hiding this comment

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

When the prox_kwargs dictionary entries are None, this will cause it to use the svmbir defaults.

To get the scico defaults, need to set prox_kwargs={"maxiter": 1000, "ctol": 0.001} or not set prox_kwargs.

This may be a little counterintuitive. @bwohlberg ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agreed. Any suggestions?

Copy link
Contributor

@tbalke tbalke Nov 16, 2021

Choose a reason for hiding this comment

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

This has been resolved by adjusting our expectations of what it means to override or omit entries in the passed dictionary.

The dictionary is seen as a whole and thus omitting an entry is like saying use whatever default the underlying method has.

Copy link
Contributor

Choose a reason for hiding this comment

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

Clarified this in 079ac16

@@ -91,7 +91,9 @@
ρ = 10 # ADMM penalty parameter
σ = density * 0.26 # denoiser sigma

f = SVMBIRWeightedSquaredL2Loss(y=y, A=A, W=Diagonal(weights), scale=0.5)
f = SVMBIRWeightedSquaredL2Loss(
y=y, A=A, W=Diagonal(weights), scale=0.5, prox_kwargs={"maxiter": 5}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it really desirable that we just drop the default stopping tolerance here?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I would choose the tolerance to be 0 (or very) low so that always 5 iterations are being performed (unless there is really almost no change)

Copy link
Contributor

@tbalke tbalke Nov 16, 2021

Choose a reason for hiding this comment

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

Addressed in a640fa7

``is_masked`` option defines a valid region for projection and updates.
Pixels outside the valid region are not projected or updated during
a reconstruction.
"""
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not clear what updates and reconstruction here refer too, since this class is just a Radon transform. Presumably it refers to the when the ParallelBeamProjector is used with SVMBIRWeightedSquaredL2Loss? If so, this should be clarified here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Clarified in commit 219e5ed

@bwohlberg bwohlberg merged commit e87cda1 into main Nov 16, 2021
@bwohlberg bwohlberg deleted the mike/approx_prox branch November 16, 2021 19:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high High priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example script ct_svmbir_ppp_bm3d_admm_cg.py broken Additional tests for svmbir interface
4 participants