{"id":38694741,"url":"https://github.com/pmelchior/proxmin","last_synced_at":"2026-01-17T10:38:52.624Z","repository":{"id":54670944,"uuid":"90391414","full_name":"pmelchior/proxmin","owner":"pmelchior","description":"Proximal optimization in pure python","archived":false,"fork":false,"pushed_at":"2022-06-13T17:00:35.000Z","size":301,"stargazers_count":118,"open_issues_count":4,"forks_count":25,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-13T11:46:44.268Z","etag":null,"topics":["nonnegative-matrix-factorization","optimization-algorithms","proximal-algorithms"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmelchior.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-05-05T15:38:16.000Z","updated_at":"2025-03-23T08:55:32.000Z","dependencies_parsed_at":"2022-08-13T23:30:37.778Z","dependency_job_id":null,"html_url":"https://github.com/pmelchior/proxmin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pmelchior/proxmin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelchior%2Fproxmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelchior%2Fproxmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelchior%2Fproxmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelchior%2Fproxmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmelchior","download_url":"https://codeload.github.com/pmelchior/proxmin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmelchior%2Fproxmin/sbom","scorecard":{"id":738747,"data":{"date":"2025-08-11","repo":{"name":"github.com/pmelchior/proxmin","commit":"66fed49e8e9a555bfdb1df8fff99034fa1bab117"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 1/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 15 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T16:42:59.093Z","repository_id":54670944,"created_at":"2025-08-22T16:42:59.094Z","updated_at":"2025-08-22T16:42:59.094Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28506593,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T10:25:30.148Z","status":"ssl_error","status_checked_at":"2026-01-17T10:25:29.718Z","response_time":85,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["nonnegative-matrix-factorization","optimization-algorithms","proximal-algorithms"],"created_at":"2026-01-17T10:38:48.291Z","updated_at":"2026-01-17T10:38:52.609Z","avatar_url":"https://github.com/pmelchior.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![PyPI](https://img.shields.io/pypi/v/proxmin.svg)](https://pypi.org/project/proxmin/)\n[![License](https://img.shields.io/github/license/pmelchior/proxmin.svg)](https://github.com/pmelchior/proxmin/blob/master/LICENSE.md)\n[![DOI](https://img.shields.io/badge/DOI-10.1007%2Fs11081--018--9380--y-blue.svg)](https://doi.org/10.1007/s11081-018-9380-y)\n[![arXiv](https://img.shields.io/badge/arxiv-1708.09066-red.svg)](http://arxiv.org/abs/1708.09066)\n\n# Proximal Minimization\n\nThe methods in this package provide solvers for constrained optimization problems. All of them use proximal operators to deal with non-smooth penalty functions.\n\nThe algorithms:\n\n* **Proximal Gradient Method (PGM/ISTA)**: forward-backward splitting with a single smooth function with a Lipschitz-continuous gradient and a single (non-smooth) penalty function. Optional multi-block optimization, Nesterov acceleration (FISTA), and Barzilai-Borwein steps.\n* **Proximal Adam and derivatives (AdamX, AMSGrad, PAdam, NAdam)**: forward-backward splitting with adaptive gradient steps for single- and multi-block optimization.\n* **Alternating Direction Method of Multipliers (ADMM)**: Douglas-Rachford splitting for two potentially non-smooth functions. We use its linearized form to solve for linear mappings in the penalty functions.\n* **Simultaneous Direction Method of Multipliers (SDMM)**: Extension of linearized ADMM for several penalty functions.\n* **Block-Simultaneous Direction Method of Multipliers (bSDMM)**: Extension of SDMM to work with objective functions that are convex in several arguments. It's a proximal version of Block coordinate descent methods.\n\nTwo-block PGM or bSDMM is used as backend solvers for Non-negative Matrix Factorization (NMF). As the algorithms allow any proxable function as constraint on each of the matrix factors, we prefer the term Constrained Matrix Factorization.\n\nDetails can be found in the [paper](https://doi.org/10.1007/s11081-018-9380-y) *\"Block-Simultaneous Direction Method of Multipliers - A proximal primal-dual splitting algorithm for nonconvex problems with multiple constraints\"* by Fred Moolekamp and Peter Melchior.\nWe ask that any published work that utilizes this package cite this paper.\n\nA description of the proximal Adam method is in the [paper](https://arxiv.org/abs/1910.10094) *\"Proximal Adam: Robust Adaptive Update Scheme for Constrained Optimization\"* by Peter Melchior, Rémy Joseph and Fred Moolekamp.\n\n## Installation and Dependencies\n\n```\npip install proxmin\n```\n\n For the latest development version, clone this repository and execute `python setup.py install`.\n\nThe code works on python\u003e2.7 and requires numpy and scipy. It is fully compatible with gradient computation by `autograd`.\n\n## Approach\n\nThe gradient-based methods PGM and Adam expect two callback function: one to compute the gradients, the other to compute step sizes. In the former case, the step sizes are bound between 0 and 2/L, where L is the Lipschitz constant of the gradient.\n\nThe penalty functions are given as proximal mappings: `X \u003c- prox(X, step)`.\n\nMany proximal operators can be constructed analytically, see e.g. [Parikh \u0026 Boyd (2014)](https://web.stanford.edu/~boyd/papers/prox_algs.html). We provide a number of common ones in `proxmin.operators`. An important class of constraints are indicator functions of convex sets, for which the proximal operator, given some point **X**, returns the closest point to **X** in the Euclidean norm that is in the set.\n\n**Example:** find the minimum of a shifted parabola on the unit circle in 2D\n\n```python\nimport numpy as np\nimport proxmin\n\ndX = np.array([1.,0.5])\nradius = 1\n\ndef f(X):\n    \"\"\"Shifted parabola\"\"\"\n    return np.sum((X - dX)**2, axis=-1)\n\ndef grad_f(X):\n    return 2*(X - dX)\n\ndef step_f(X, it=0):\n    L = 2. # Lipschitz constant of grad f\n    return 1 / L\n\ndef prox_circle(X, step):\n    \"\"\"Projection onto circle\"\"\"\n    center = np.array([0,0])\n    dX = X - center\n    # exclude everything other than perimeter of circle\n    phi = np.arctan2(dX[1], dX[0])\n    return center + radius*np.array([np.cos(phi), np.sin(phi)])\n\nX = np.array([-1.,-1.]) # or whereever\nconverged, grad, step = proxmin.pgm(X, grad_f, step_f, prox=prox_circle)\n```\n\nSince the objective function is smooth and there is only one constraint, one can simply perform a sequence of *forward-backward* steps: a step in gradient direction, followed by a projection onto the constraint subset. That is, in essence, the proximal gradient method.\n\nIf both functions are not smooth, one can use ADMM. It therefore operates on two proxed functions. Unlike PGM, feasibility is only achieved at the end of the optimization and only within some error tolerance.\n\nContinuing the example above, the smooth function gets turned into a proxed function by performing the gradient step internally and returning the updated position:\n\n```python\ndef prox_gradf(X, step):\n    \"\"\"Proximal gradient step\"\"\"\n    return X-step*grad_f(X)\n\nconverged = proxmin.admm(X, prox_gradf, step_f, prox_g=prox_circle, e_rel=1e-3, e_abs=1e-3)\n```\n\n## Constrained matrix factorization (CMF)\n\nMatrix factorization seeks to approximate a target matrix `Y` as a product of `np.dot(A,S)`. If those constraints are only non-negativity, the method is known as NMF.\n\nWe have extended the capabilities by allowing for an arbitrary number of constraints to be enforced on either matrix factor:\n\n```python\n# PGM approach for each factor\nprox_A = ... # a single constraint on A, solved by projection\nprox_S = ... # a single constraint on S, solved by projection\nA0, S0 = ... # initialization\nproxmin.nmf.nmf(Y, A0, S0, prox_A=prox_A, prox_S=prox_S)\n\n# same with AdaProx-AMSGrad\nproxmin.nmf.nmf(Y, A0, S0, prox_A=prox_A, prox_S=prox_S, algorithm=proxmin.algorithms.adaprox, scheme=\"amsgrad\")\n\n# for multiple constraints, solved by ADMM-style split\nproxs_g = [[...], # list of proxs for A\n           [...]] # list of proxs for S\nA, S = proxmin.nmf.nmf(Y, A0, S0, algorithm=proxmin.algorithms.bsdmm, proxs_g=proxs_g)\n# or a combination\nA, S = proxmin.nmf.nmf(Y, A0, S0, algorithm=proxmin.algorithms.bsdmm, prox_A=prox_A, prox_S=prox_S, proxs_g=proxs_g)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmelchior%2Fproxmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmelchior%2Fproxmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmelchior%2Fproxmin/lists"}