-
Notifications
You must be signed in to change notification settings - Fork 15
Objective Sensitivity 2.0 #303
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
base: master
Are you sure you want to change the base?
Conversation
….jl into ar/dualparameter
* fix conic error * use jump psd problem * [docs] update to Documenter@1 (#286) * [docs] update to Documenter@1 * Update * update * format * Pass attributes through Objective.FunctionConversionBridge (#287) * Pass attributes through Objective.FunctionConversionBridge * Fix * add test * fix tol * fix test * add reverse test --------- Co-authored-by: joaquimg <[email protected]> * bump POI * cleanup --------- Co-authored-by: Oscar Dowson <[email protected]> Co-authored-by: Benoît Legat <[email protected]> Co-authored-by: joaquimg <[email protected]>
* prepare more tests * sketch * temp examples * remove printing * remove printing * remove duplicatie def * move definition * format * format * simplify conic model * force nlp on nlp tests * fix param tests * cleanup parameter usage * remove code * cleanup usage of parameters * format * add temp dep * format * add temp dep * fix PSDSquare * temp fix for tests * format
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #303 +/- ##
==========================================
+ Coverage 88.94% 89.13% +0.19%
==========================================
Files 16 16
Lines 2045 2090 +45
==========================================
+ Hits 1819 1863 +44
- Misses 226 227 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
docs/src/usage.md
Outdated
Using Lagrangian duality we could already calculate the objective sensitivity with respect to parameters that appear in the RHS of the constraints (e.g, `cons` in this case for parameter `p`) - i.e. The objective sensitivity w.r.t. a parameter change in the RHS of the constraints is given by the optimal multiplier. | ||
|
||
On the other hand, if the parameter appears in the LHS of the constraints, we can calculate the objective sensitivity with respect to the parameter using: the sensitivities of the variables with respect to the parameter, \( \frac{\partial x}{\partial p} \), and the gradient of the objective with respect to the variables \( \frac{\partial f}{\partial x} \): |
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.
So this means you can compute it using the dual objective if you only have parameters as constraint constants and you can also use it with the primal objective using the solution sensitivity which also works even if you have parameters as constraint coefficients.
2 questions the readers might have:
- If you only have parameters on the constraint constants, would computing the sensitivity using the primal or dual objective match ?
- Why not use the dual objective but also include the sensitivity of the dual solution ?
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.
Probably it would make sense to also add ForwardDualObjectiveSensitivity
(in another PR of course) ?
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.
This is a good point. I will add an issue for this.
My naive response for now is:
If you only have parameters on the constraint constants, would computing the sensitivity using the primal or dual objective match?
Yes, and we add this as a test. Also added a sentence on this:
Line 155 in 43d6eb8
Note that, if the parameter appears as a constant in a constraint, the objective sensitivity calculated through solution sensitivity is equivalent to the optimal multiplier associated with the constraint. |
Why not use the dual objective but also include the sensitivity of the dual solution?
Added a sentence on this (and equivalence under strong duality) and will create an issue
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.
Sentence:
Lines 189 to 194 in f8042b9
**Dual Objective Sensitivity** | |
In addition to the primal objective sensitivity, one could also calculate the dual objective sensitivity with respect to the parameters using the gradients of the dual objective and the sensitivities of the dual variables with respect to the parameters. | |
This is currently not implemented for any problem class, but will be available in future releases. | |
Note that the dual objective sensitivity is equivalent to the primal objective sensitivity problems where strong duality holds. |
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.
Issue #315
Had issues with my old pr (#282). So this one is the updated version.