-
Notifications
You must be signed in to change notification settings - Fork 429
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
Issue with CWLS in dki #3222
Comments
Thank you for this complete report @samcoveney. This worries me also. Can you have a look @RafaelNH and @arokem since you are more familiar with DKI? if it is a solver issue, we might have to contact Thank you very much. |
Thanks. As a point, a lot of work has gone into #3170 which generalized the weights usable in WLS routines in both dti.py and dki.py, so if we can figure out the issue, please don't race ahead and implement a fix that it gonna be difficult for (or incompatible with) #3170 - if we can figure the problem, I can probably fold it into my PR |
Sorry if not helpful, but trying to help with brain-storming the problem early on. By first doing
and so on... (there is more to it) Sometimes, I get failure of the solver with |
Okay, no movement on this. I'm chalking it up to the solver failing for now, and so i will turn off the noise in tests in #3170 that is causing failure. I will try to return to the matter in the future. |
I need some help figuring out if there is a problem with constrained WLS in the DKI module. See
dipy/reconst/dki.py
dipy/dipy/reconst/dki.py
Lines 2611 to 2619 in e5cc120
So here we see that, in order to solve a weighted least squares problem, we define W as "signal" (such that W is that square root of the weight matrix that would be applied to the squared residuals, which is "signal squared"). Then we redefine
y
andA
so that we can solve the weight least squares problem. This is fine as a way to solve WLS, see https://en.wikipedia.org/wiki/Weighted_least_squaresThe problem is that we are performing constrained weighted least squares. The positivity constraints are set up here:
dipy/dipy/reconst/dki.py
Lines 1795 to 1814 in e5cc120
But my understanding is that these constraints are set up with the understanding that
y
is log(signal). But we redefiney
in the constrained weighted least squares.As detailed in #3170 I am having problems writing the tests for CWLS (several of which were missing...) using noisy data - the tests keep failing. No problem with non-noisy data, probably because the solver detects that the problem is already solved (weighting zero residuals results in zero-residuals i.e. no effect).
For example:
Resulting in:
Note that I have rebased on master today, and the problem persists.
Given my worries about the problems with the theory (that we have supplied constraints designed for
log(signal)
to a solver usingsignal*log(signal)
, I think we should be worried that the constrained solver is not really working properly for this case.edit: in addition to my theoretical worries about CWLS, note that adding noise to the signal also produces this error, regularly, for CLS... the plot thickens
The text was updated successfully, but these errors were encountered: