Skip to main content

Q-MM: A Python toolbox for Quadratic Majorization-Minimization

DOI licence pypi status version maintained Poetry Documentation Status

image

Q-MM is a Python implementation of Majorize-Minimize Quadratic optimization algorithms. Algorithms provided here come from

[1] C. Labat and J. Idier, “Convergence of Conjugate Gradient Methods with a
Closed-Form Stepsize Formula,” J Optim Theory Appl, p. 18, 2008.

and

[2] E. Chouzenoux, J. Idier, and S. Moussaoui, “A Majorize–Minimize Strategy
for Subspace Optimization Applied to Image Restoration,” IEEE Trans. on
Image Process., vol. 20, no. 6, pp. 1517–1528, Jun. 2011, doi:
10.1109/TIP.2010.2103083.

See documentation for more background. If you use this code, please cite the references above and a citation of this toolbox will also be appreciated, see below. You can also click ⭐ on the repo.

Quadratic Majorize-Minimize

The Q-MM optimization algorithms compute the minimizer of objective function like

J(x) = ∑ₖ μₖ ψₖ(Vₖ·x - ωₖ)

where x is the unknown vector, Vₖ a linear operator, ωₖ a fixed data, μₖ a scalar, ψₖ(u) = ∑ᵢφₖ(uᵢ), and φₖ a function that must be differentiable, even, coercive, φ(√·) concave, and 0 < φ'(u) / u < +∞.

The optimization is done thanks to quadratic sugorate function. In particular, no linesearch or sub-iteration is necessary, and close form formula for the step are used with guaranteed convergence.

A classical example, like in the figure below that show an image deconvolution problem, is the resolution of an inverse problem with the minimization of

J(x) = ||² + μ ψ(V·x)

where H is a low-pass forward model, V a regularization operator that approximate gradient (kind of high-pass filter) and ψ an edge preserving function like Huber. The above objective is obtained with k ∈ {1, 2}, ψ₁(·) = ||², V₁ = H, ω₁ = y, and ω₂ = 0.

image

Features

  • The mmmg, Majorize-Minimize Memory Gradient algorithm. See documentation and [2] for details.
  • The mmcg, Majorize-Minimize Conjugate Gradient algorithm. See documentation and [1] for details.
  • No linesearch: the step is obtained from a close form formula without sub-iteration.
  • No conjugacy choice: a conjugacy strategy is not necessary thanks to the subspace nature of the algorithms. The mmcg algorithm use a Polak-Ribière formula.
  • Generic and flexible: there is no restriction on the number of regularizer, their type, ..., as well as for data adequacy.
  • Provided base class for objectives and losses allowing easy and fast implementation.
  • Just one file if you like quick and dirty installation, but available with pip.
  • Comes with examples of implemented linear operator.

Installation and documentation

Q-MM is essentially just one file qmm.py. We recommend using poetry for installation

poetry add qmm

The package can also be installed with pip. More options are described in the documentation.

Q-MM only depends on numpy and Python 3.6.

Example

The demo.py presents an example on image deconvolution. The first step is to implement the operators V and the adjoint Vᵀ as callable (function or methods). The user is in charge of these operators and these callable must accept a unique Numpy array x and a unique return value (partial in the functools module in the standard library is usefull here). There is no constraints on the shape, everything is vectorized internally.

After import of qmm, user must instantiate Potential objects that implement φ and Objective objects that implement μ ψ(V·x - ω)

import qmm
phi = qmm.Huber(delta=10)  # φ

data_adeq = qmm.QuadObjective(H, Ht, HtH, data=data)  # ||y - H·x||²
prior = qmm.Objective(V, Vt, phi, hyper=0.01)  # μ ψ(V·x) = μ ∑ᵢ φ(vᵢᵗ·x)

Then you can run the algorithm

res = qmm.mmmg([data_adeq, prior], init, max_iter=200)

where [data_adeq, prior]{.sourceCode} means that the two objective functions are summed. For more details, see documentation.

Contribute

Author

If you are having issues, please let us know

orieux AT l2s.centralesupelec.fr

More information about me here. F. Orieux and R. Abirizk are affiliated to the Signal and Systems Laboratory L2S.

Citation

Q-MM has a DOI with Zenodo DOI. Specific version can also be cited. Citation can be

François Orieux, & Ralph Abirizk. (2022). Q-MM: The Quadratic Majorize-Minimize
Python toolbox (v0.12.0). Zenodo. https://doi.org/10.5281/zenodo.6373070

A example of bibtex is

@software{francois_orieux_2022_6373070,
  author       = {François Orieux and Ralph Abirizk},
  title        = {Q-MM: The Quadratic Majorize-Minimize Python toolbox},
  month        = mar,
  year         = 2022,
  publisher    = {Zenodo},
  version      = {0.12.0},
  doi          = {10.5281/zenodo.6373069},
  url          = {https://doi.org/10.5281/zenodo.6373069}
}

Acknowledgement

Author would like to thanks J. Idier, S. Moussaoui and É. Chouzenoux. É. Chouzenoux has also a Matlab package that implements 3MG for image deconvolution that can be found on her webpage.

License

The project is licensed under the GPLv3 license.

Release files for qmm 0.19.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for qmm 0.19.0
File Size Uploaded
qmm-0.19.0.tar.gz 31.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for qmm 0.19.0
File Interpreter ABI Platform
qmm-0.19.0-py3-none-any.whl Python 3 none any Details

Total release size: 63.7 kB

Release files / qmm-0.19.0.tar.gz

Download URL qmm-0.19.0.tar.gz
Size 31.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b439498e7e6109751e6f4bf91d13cb13bb9bb35b080b9d41a964daead61b775f
BLAKE2b-256 checksum
How to use checksums
03937c07d4d58112f4f66654593ab48c878a61a87b099be77536da1aab1073a4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.12.3 Linux/6.14.0-37-generic

Release files / qmm-0.19.0-py3-none-any.whl

Download URL qmm-0.19.0-py3-none-any.whl
Size 31.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed0ce7bff28befdf69889f3d3e653c7b9f08a9fe71a0e1773b5b1924358f9c28
BLAKE2b-256 checksum
How to use checksums
6803fc15b76441a9ebd3a001a12f76fa20da622dd3dbcef304be78b4955a9051
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.3.1 CPython/3.12.3 Linux/6.14.0-37-generic

Release history Release notifications | RSS feed

This release

0.19.0 This release

2 release files

0.18.2

2 release files

0.18.1

2 release files

0.18.0

2 release files

0.17.0

2 release files

0.13.1

2 release files

0.13.0

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page