-
Notifications
You must be signed in to change notification settings - Fork 17
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 check for A not linop in prox #220
Conversation
In def test_squared_l2(self):
L = loss.SquaredL2Loss(y=self.y, A=self.Ao)
assert L.has_eval == True
assert L.has_prox == False # not diagonal
def test_weighted_squared_l2(self):
L = loss.WeightedSquaredL2Loss(y=self.y, A=self.Ao, W=self.W)
assert L.has_eval == True
assert L.has_prox == False # not diagonal with
However, |
In what way was it redundant? |
We had if isinstance(self.A, linop.Diagonal) and isinstance(self.W, linop.Diagonal):
self.has_prox = True At this point |
But what if |
Then So it is either |
Previously (some months ago), the prox was only defined if the linear operator was diagonal. That changed when you (I think) added a CG solution for non-diagonal case. I would have assumed that this test was a remnant from before, but that doesn't explain why it only started failing now. |
OK, that makes sense. The full context is not apparent in the diff! |
Correct. I think that the test fails because this is not an appropriate test. I suggest changing the test to the negation. If the A is a linop then |
That seems reasonable, but I'm a bit concerned that we don't understand why the tests only started failing now. |
The previous test asserted that Fixing the loss.py code made fixing the test code necessary. |
That makes sense w.r.t. tests, but it is a bit strange that we did not previously noticed that the new prox capability that was added was crippled by this oversight. Nevertheless, you may as well go ahead and make the proposed changes to the tests. |
Codecov Report
@@ Coverage Diff @@
## main #220 +/- ##
==========================================
- Coverage 92.44% 92.42% -0.03%
==========================================
Files 49 49
Lines 3429 3431 +2
==========================================
+ Hits 3170 3171 +1
- Misses 259 260 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but let's ask @Michael-T-McCann to take a look too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it still strikes me as odd every time we call CG "a prox," this PR seems in keeping with the currently design.
See #215
Note that check for
self.has_prox
, namely thatW
isDiagonal
, was redundant and so I removed it.