-
Notifications
You must be signed in to change notification settings - Fork 10
Generalize Binf → Box Constraints #144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@dpo please review this pr. |
|
Many thanks @arnavk23 ! I'll have a look. Please don't commit the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR successfully generalizes shifted proximal operators from Binf (L∞-ball) constraints to Box constraints, enabling support for arbitrary box bounds [l, u] while maintaining backward compatibility with symmetric constraints [-Δ, Δ].
Key Changes
- Enhanced existing Box variants (ShiftedIndBallL0Box, ShiftedGroupNormL2Box) with dual signature support for both general and symmetric constraints
- Added backward compatibility layer that automatically returns Box variants for legacy Binf signatures
- Updated test references and type expectations to match the new Box variant signatures
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/runtests.jl | Updated test references from Binf to Box variants and adjusted type expectations with additional type parameters |
| src/shiftedIndBallL0Box.jl | New Box variant for IndBallL0 with general box constraints and backward compatibility |
| src/shiftedGroupNormL2Box.jl | New Box variant for GroupNormL2 with general box constraints and backward compatibility |
| src/ShiftedProximalOperators.jl | Added includes for new Box variants and enhanced getproperty method for backward compatibility |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #144 +/- ##
==========================================
- Coverage 73.71% 72.54% -1.18%
==========================================
Files 22 26 +4
Lines 898 1060 +162
==========================================
+ Hits 662 769 +107
- Misses 236 291 +55 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@arnavk23 I think one of the warnings due to methods being overwritten is caused by this PR?! I'll open issues for the others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
…ocations in group prox implementations; update includes and tests (follow PR JuliaSmoothOptimizers#104 pattern)
…lear norm, rank, and IndBallL0 Box
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 12 out of 13 changed files in this pull request and generated 2 comments.
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Co-authored-by: Copilot <[email protected]>
Successfully implemented the generalization from Binf (L∞-ball) constraints to Box constraints across all applicable shifted proximal operators, following the pattern established in PR #104 for ShiftedRootNormLhalfBox.
Key Changes
Enhanced existing Box variants: ShiftedIndBallL0Box, ShiftedGroupNormL2Box, and ShiftedRootNormLhalfBox
Dual signature support: Each Box variant now supports both:
General box constraints: shifted(h, x, l, u) for arbitrary bounds [l, u]
Symmetric constraints: shifted(h, x, Δ, χ) for symmetric bounds [-Δ, Δ] (backward compatibility)
Box implementations now override the corresponding Binf method signatures
Legacy code using (Δ, χ) signatures automatically returns Box variants instead of Binf variants
Maintains full backward compatibility while providing enhanced functionality
Enhanced getproperty method to provide backward-compatible access to ψ.Δ and ψ.χ properties on Box variants
Automatic conversion from symmetric box constraints [-Δ, Δ] back to radius Δ when accessed
Seamless integration with existing code expecting Binf-style properties
Updated all test references from ShiftedGroupNormL2Binf and ShiftedIndBallL0BInf to their respective Box variants
Fixed type expectations to match Box variant signatures with additional type parameters
Implemented appropriate numerical tolerance using isapprox with atol for precision differences between algorithms
Verified set_radius! methods work correctly with all Box variants
Proper export statements and module includes already in place
Smart bounds conversion: set_radius!(ψ, Δ) automatically sets bounds to [-Δ, Δ]
Closes #88