-
Notifications
You must be signed in to change notification settings - Fork 120
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
Add support for using Problem as an atom #646
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #646 +/- ##
=======================================
Coverage 97.88% 97.89%
=======================================
Files 88 88
Lines 5112 5120 +8
=======================================
+ Hits 5004 5012 +8
Misses 108 108 ☔ View full report in Codecov by Sentry. |
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.
the code changes look good.
I think we should also test non-scalar "objectives", since those should be allowed in this setting (but multiobjective in general is not supported). Similar to the last example of https://cvxr.com/cvx/doc/advanced.html#new-functions-via-partially-specified-problems. Taking our huber
atom and writing it as a partially specified problem:
function huber(c, M=1.0)
s = Variable(size(c))
n = Variable(size(c))
return minimize(square(s) + 2 * M * abs(n), c == s + n)
end
Okay, so the benefit of writing out The downside is that multiple calls to That's an interesting trade-off. |
so I think actually they will be cached, since the So I think the main limitation is that there isn't a way (currently) to promise additional DCP properties that can't be derived (like maybe it is positive or increasing or something like that but it couldn't be derived automatically), which we can "inject" with atoms by defining |
Added a test for caching and the array return. |
Take II at #310
See also #636