comp-imaging / ProxImaL

A domain-specific language for image optimization.
MIT License
112 stars 29 forks source link

I want to compare the elements of the array of two variables and use the larger value as the new variable. #60

Open HIROJAPAN opened 3 years ago

HIROJAPAN commented 3 years ago

Is it possible to apply two convolution filters to the variable X, compare the elements of the two arrays, and choose the larger value? And can ProximaL solve the problem?

antonysigma commented 1 year ago

If I understand your question, are you trying to compute the "L_p,q norm" of the signal?

Image a = conv(A, x)
Image b = conv(B, x)

Problem = group_norm(vstack(reshape_to_row_vector(a), reshape_to_row_vector(b)), p = 'Infinity', q = 2).

Yes you can express this problem with ProxImaL, but you will have to implement your own proximal function for L_p,q. Also, deferring to @SteveDiamond regarding the convexity of such problem.

For general convex optimization problems, I also suggest you post the questions on https://github.com/cvxpy/cvxpy . They have a larger community.

SteveDiamond commented 1 year ago

This could also be implemented as an elementwise maximum of a and b. This is convex and would be pretty easy to add.