TomographicImaging / CIL

A versatile python framework for tomographic imaging
https://tomographicimaging.github.io/CIL/
Apache License 2.0
97 stars 45 forks source link

Weighted L2 norm - weight with a CIL linear operator? #1984

Open MargaretDuff opened 2 weeks ago

MargaretDuff commented 2 weeks ago

Description

Discussed with @bosschmidt at the CIL user meeting hackathon.

For the weighted L2 norm in CIL, the weight value can be a scalar or can be a CIL data container : https://github.com/TomographicImaging/CIL/blob/5d569dc054759a8c137ca72611fc7be07be6080e/Wrappers/Python/cil/optimisation/functions/L2NormSquared.py#L125 Mathematically, $F(x) = |x|_{W,2}^2 = \Sigma_iw_ix_i^2 = \langle x, Wx\rangle = x^TWx$ where $W=\text{diag}(weight)$ if weight is a DataContainer or $W=\text{weight} I$ if weight is a scalar.

It might be useful to extend this so that $W$ is a linear operator whose range and domain are the same and contain the input $x$.

This would allow the weighted L2norm to be weighted by non-diagonal matrices.