-
Notifications
You must be signed in to change notification settings - Fork 18
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
[Enhancement] Fix Generic Cost to actually account for Proximities from variable splitting methods #80
Comments
@chaithyagr I don't understand what you are saying. What you replaced in the PR is just for |
@zaccharieramzi I understand the point you are making. However, I am coming from usability standpoint. Let me use the case of SparseThreshold for this. Op Method: Cost Method: We can see that the linear operator exists only in cost operation while not in the op method. I could use condatvu directly with OWL(coeff) (as after all condatvu sends coefficients), however, in the calculation of cost, we have an issue as condatvu sends image domain as input to calculate cost. Now, the ideally right way must fix:
or
Please correct me if I got anything wrong above. |
I don't understand your point. However, I didn't look at |
So yes I am seeing that |
So what you are saying is basically have every Prox Op that we will implement, needs to have an extra linear_op, which by default would be Identity. This seems to be overkill just to handle the cases for variable splitting methods. I was under the assumption that the purpose of Now we have following options:
pysap-mri/mri/optimizers/utils/cost.py Line 136 in c39764b
We can accept an extra parameter, which defines if we are handling variable splitting (mainly condatvu) and replace cost function with gradient_cost(x) + prox_cost(y) The last solution seems to be most general in my opinion. |
Renaming the issue and also removing the tag that it is a bug and adding enhancement |
However this is exactly what is done with I don't understand what solution 2. is, but yes the other 2 are sensible in my opinion. We would need to understand why there was such a design decision first that is: why have the |
Oh sorry for bad writing. By 2 I just mean that we have an operator just to fix the cost call, which surely isnt right, as it doesn't exactly implement any function. I will go ahead with fixing this in costOp in MRI and transfer this issue to pysap-mri |
Wait, we should first have @sfarrens on this because I want to understand the origin of this design first. |
Hi @chaithyagr and @zaccharieramzi, I am not sure I got what the exact question was, but I can try at least to explain the reason for how ModOpt handles proximity operators. For any given proximity operator the This |
Well I think @zaccharieramzi 's point is that (please correct me if I am wrong) we could have the proximities just to handle what they intend to do, ie the proximity and cost (with no idea of the linear operator). It could be up to the algorithm to call the cost and proximities right. |
I agree with what @chaithyagr has just said. |
OK, sounds good to me. |
@zaccharieramzi can we say that this is now tackled and close this? |
Well except the fact we still have this |
Closing. |
Describe the bug
Currently the linear composition operator carries out linear operation and adjoint operation, this must not be done as all the algorithms generally carry out the proximity on the wavelet domain coefficients directly.
https://github.com/CEA-COSMIC/ModOpt/blob/609ecded944b6bfd746106c917d6043219701fa4/modopt/opt/proximity.py#L319-L321
The fix is minor, we just need to remove these extra operations.
Are you planning to submit a Pull Request?
UPDATED
Based on discussion, we plan to fix the Generic Cost Operator here so that it can accept x_new and y_new and calculate cost right in analysis formulation
The text was updated successfully, but these errors were encountered: