Convex.jl icon indicating copy to clipboard operation
Convex.jl copied to clipboard

Making Convex.jl DPP compliant

Open akshay326 opened this issue 5 years ago • 14 comments

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)

akshay326 avatar Mar 31 '20 13:03 akshay326

DPP compliance needs adding two more constraints apart from already existing ones. But firstly supporting a parameter type object is imperative :sweat_smile:

akshay326 avatar Mar 31 '20 14:03 akshay326

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.

ericphanson avatar Apr 01 '20 00:04 ericphanson

A distinction between parameters and variables will suffice, at least on the data structure level. Then we find the derivative in following steps

  1. Convex.jl already canonicalizes a Model object 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.
  2. 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).
  3. Feed the perturbations to AD system (there's another step, obtaining a reverse map, similar to the first step)

akshay326 avatar Apr 01 '20 10:04 akshay326

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.

ericphanson avatar Apr 01 '20 12:04 ericphanson

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)

JinraeKim avatar Oct 27 '21 08:10 JinraeKim

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.

odow avatar Oct 27 '21 19:10 odow

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 :)

JinraeKim avatar Oct 27 '21 23:10 JinraeKim

This can also be closed since done in DiffOpt

matbesancon avatar May 10 '22 07:05 matbesancon

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?

JinraeKim avatar May 10 '22 07:05 JinraeKim

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).

odow avatar May 10 '22 08:05 odow

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.)

ericphanson avatar May 10 '22 10:05 ericphanson