Repository navigation
Fix: preserve feasible inputs in L1 ball projection - #268
Conversation
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.
mrava87
left a comment
There was a problem hiding this comment.
@mikamikasuki well spotted. Just a few minor improvements on the tests docstrings, then I think this is good to go.
|
@claude review. |
|
Claude finished @mrava87's task in 15s —— View job Review of PR #268The fix is correct and minimal. Projecting a point already in the ball now returns it unchanged. The docstring now gives the full piecewise formula, and it also fixes the old Suggestions
I have nothing else to flag. Once the docstrings are updated, I think this is good to go. |
L1BallProjalways projected onto the simplex boundary, so an input already inside the L1 ball was changed. For example, projecting[0.1, -0.2]with radius 1 returned approximately[0.45, -0.55]instead of the input.Return feasible inputs unchanged before applying the existing boundary projection, and document the complete piecewise formula. Add regressions for real and complex interior, boundary and zero vectors, and the corresponding dual proximal operator.
Validation: 54 projection tests pass; all Ruff checks and strict mypy checks pass. An independent sorting-based reference agrees with 1,000 real and complex interior/exterior projections. The full suite has 275 passing tests and one complex64 bilinear tolerance failure, which also occurs on the clean base revision (253 passing tests).
AI assistance: Codex generated the fix, tests and this description.