Repository navigation
Fix: align SplitBregman docs and cost with implementation, fix tol=0 - #809
Merged
Merged
Conversation
- doc: effective L1 weight is epsRL1s**2 (eps is both the weight of the augmented L2 term and the shrinkage threshold); use d_i for the split variable, add tau to the Bregman update, describe the x-subproblem solvers, and fix several docstring errors - fix: recorded cost now matches the documented cost function (1/2 on the L2 terms and epsRL1s**2 on the L1 terms) - fix: tol=0 no longer skips all outer iterations - test: add tests for tol=0 and for the cost function Closes PyLops#808 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 0 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #808.
Docs
epsRL1s[i]**2:epsRL1s[i]is used both as the weight of the augmented L2 term in the x-subproblem and as the threshold of the shrinkage step. The cost function in the Notes, the constrained/split formulation, and theepsRL1sparameter descriptions now reflect this.d_ifor the split variable (wasy_i, clashing with the datay), and addtauto the Bregman update.scipy.sparse.linalg.lsqrforengine="scipy"with NumPy arrays,cglsforengine="pylops"or other array types) and the closed-form shrinkage of the d-subproblem, including the stopping criterion.nregsL1attribute (should benregsL2), types ofb/d, OMP/IRLS copy-paste instep/run, size of the initial guess returned bysetup,engine/show_inner/kwargs_lsqrdescriptions mentioning lsqr only, over-indenteditershow/preallocateinsplitbregman, "Split-Bergman" typo.Code
1/2on the L2 terms andepsRL1s**2on the L1 terms (previouslyepsRL2swithout1/2, and unit weight on L1). The solution is unchanged.tol=0no longer skips all outer iterations: the model-update norm is initialized toinf, so at least one iteration is always run.Tests
test_SplitBregman_tol0: allniter_outeriterations are run withtol=0.test_SplitBregman_cost:cost[0]matches the documented cost computed by hand (with both L1 and L2 terms and nonzerodataregsL2).🤖 Generated with Claude Code