pyxu-org / pyxu

Modular and scalable computational imaging in Python with GPU/out-of-core computing.
https://pyxu-org.github.io/
MIT License
117 stars 17 forks source link

Feature/deblur example #55

Closed joanrue closed 1 year ago

joanrue commented 1 year ago

Adds a simple deblurring example to showcase Pyxu

matthieumeo commented 1 year ago

Thanks for the cool example @joanrue. This PR was merged with master upon minor edits/clarifications (see commits 3d0c32445e08b9b8b3a2f15947bcd28e9e1f4586 and 07d398ac335fdaf36fecda93db10dc9752fce8fb, respectively).

Note that the computation of the diff_lipschitz of the loss is theoretically not necessary, and the fact that you had to compute it means there is a bug in the arithmetic. I have notified @SepandKashani who will look into it and propose a fix (most likely a bug within ChainRule or in the update of diff_lipschitz when creating of a QuadraticOp).

Also, you're treating all channels independently in this example, which could create border effects where the borders enforced by TV within each channel do not coincide. It is possible to generalise TV to multiple channels, for example using the $L_{F,1}$ norm of the Jacobian instead of the gradient. It could be interesting in the future to update the example along those lines.