Convex.jl
Convex.jl copied to clipboard
Making Convex.jl DPP compliant
Hi Team
I read about the project to enable JuMP.jl differentiate solution of problem w.r.t. its parameters.
CVXPY implemented this ability and the article accompanying this feature describes a new grammar named DPP, subset of the DCP system.
Does Convex.jl defines a parameter class like a variable or constraint? (I didn't find any implementation like this one)
DPP compliance needs adding two more constraints apart from already existing ones. But firstly supporting a parameter type object is imperative :sweat_smile:
Convex doesn’t have such a type yet though we could add one. One thing you can do now is fix! a variable to different values, which kind of mimics a parameter, except we can’t do the DPP checking.
If we added those, what next would we need to differentiate through programs? I haven’t read much about it yet, but it sounds cool.
A distinction between parameters and variables will suffice, at least on the data structure level. Then we find the derivative in following steps
- Convex.jl already canonicalizes a
Modelobject to cone program. We'll need to obtain a map from parameters of original problem to data of cone program. The article proves that this map will be a matrix, affine in the parameters, if the problem is DPP compliant. - Obtain perturbations of data of cone program wrt original problem parameters (I still need to understand this in detail :sweat_smile: - has a whole article devoted to this step).
- Feed the perturbations to AD system (there's another step, obtaining a reverse map, similar to the first step)
Interesting. To me it sounds like a lot of this will have to be on the MathOptInterface side of things, since that’s what does many of the transformations to result in the final model / problem data. But Convex definitely seems like the right place for the DPP guarantees.
Is there any timetable to support this feature? :)
EDIT: For me, it is a very attractive feature and now I consider that moving to Python for cvxpylayers. If this feature is supported by Convex.jl like cvxpylyaers, it would be very useful for researchers and engineers who deal with machine learning and convex optimisation :) (especially for Julians like me)
There is no timetable. @ericphanson has left academia, so Convex.jl is essentially in maintenance mode. Although we can still review and merge PRs if you're interested in contributing.
There is no timetable. @ericphanson has left academia, so Convex.jl is essentially in maintenance mode. Although we can still review and merge PRs if you're interested in contributing.
Thank you :)
This can also be closed since done in DiffOpt
This can also be closed since done in DiffOpt
Just for my curiosity, could you refer to any PR, issue, or docs to check this?
DiffOpt is here: https://github.com/jump-dev/DiffOpt.jl
But it'd need some integration work with Convex before I'd close this issue (even if just an example or a blog post to demonstrate how to use it).
Yeah, I believe this issue is about creating a tracking system to verify DPPness, just like we do for convexity (DCPness). I don’t think DiffOpt does this.
(Similar in spirit to https://github.com/jump-dev/Convex.jl/issues/138#issuecomment-609541914 which discusses extending the tracking system to operator convexity and operator concavity.)