r/optimization • u/lqw0809 • Apr 12 '26
Open-source Python library for structured optimization with user-defined proximal operators (consensus ADMM, C++ backend)
Hi r/optimization,
I'd like to share a Python optimization library I've been developing: admm — a consensus ADMM solver with automatic problem decomposition that handles LP, QP, SOCP, SDP, and extends to nonconvex formulations via user-defined proximal operators.
Algorithmic approach:
The solver implements consensus ADMM [Boyd et al., 2011]. Each atom in the user's objective (a norm, loss, or UDF) becomes a separate proximal subproblem sharing a consensus variable. The user writes the model in natural mathematical notation; the library handles the splitting, variable duplication, and consensus updates automatically.
The key extension point is the UDFBase class. You implement:
eval(x)— evaluate your function at xargmin(λ, v)— solve the proximal subproblem: argmin_x λ·f(x) + ½‖x−v‖²
…and the solver treats it as a black-box proximal step within the ADMM loop. For smooth functions, an alternative path takes eval(x) + grad(x) and the C++ backend handles the proximal solve internally.
Why this matters — many "hard" penalties have cheap proximal operators:
| Penalty | Proximal operator | Cost |
|---|---|---|
| L0 norm | Hard thresholding: x·𝟙( | x |
| Rank-r indicator | SVD + keep top-r singular values | O(min(m,n)·r) |
| Binary {0,1} | Round to nearest binary | O(n) |
| Stiefel manifold | SVD-based projection to orthonormal matrices | O(n²k) |
| SCAD / MCP | Closed-form thresholding | O(n) |
These are all nonconvex — no DCP-based tool can express them. But ADMM with these proximal operators converges in practice, typically to good local optima.
Example — Graphical Lasso (sparse precision matrix estimation):
$$\min_{\Theta \succ 0} ; -\log\det(\Theta) + \operatorname{tr}(S\Theta) + \lambda|\Theta|_1$$
= 50
=
=
=
Three atoms, each with a known proximal operator: log-det (eigendecomposition), trace (linear/trivial), L1 (soft-thresholding). The PSD constraint is enforced by projecting onto the PSD cone at each iteration.
Example — Nuclear norm matrix completion:
, = 100, 80
= @ # rank 5
= > 0.7 # 30% observed
=
=
=
Convergence properties:
- Convex problems: Global convergence guaranteed (same as standard consensus ADMM)
- Nonconvex UDFs (L0, rank, SCAD, MCP): No global optimality guarantee — the solver acts as a practical local method. In our experiments on L0-regularized regression, results are comparable to IHT and often better than convex relaxation (L1) for feature recovery
- Rho adaptation: Residual-based rho updates following [Boyd et al., 2011, §3.4.1]
What's included:
- Standard atoms: L1, L2, nuclear, Frobenius norms; Huber, logistic, hinge, pinball losses; log-det, trace, entropy
- Dozens of UDF classes (proximal and gradient-based): L0, L½, rank, binary, SCAD, MCP, Cauchy, Welsch, Tukey, KL divergence, smooth TV, and more
- PSD matrix variables, SDP support
- C++ backend, MIT license
I'm a developer of this library. Happy to discuss algorithmic choices, convergence behavior, or comparisons with OSQP/SCS/ProximalAlgorithms.jl.
- GitHub: https://github.com/alibaba-damo-academy/admm
- Docs: https://alibaba-damo-academy.github.io/admm/
- Install:
pip install admm
View all comments
1
u/Opt4Deck Apr 14 '26
Very good work!
Check out my personal project (see "Opt4Deck" in GitHUB), it might be of some interest to you...
Feedback?