Closed odow closed 6 months ago
My hot take.
There may be other uses of sign
we cannot anticipate, which don't have such an obvious work around.
If the following conditions are met,
Then I think it is good to add support for it.
I hear your point that this will likely lead to a bunch of non-ideal modeling choices by non-experts. However, that issue is not limited to this specific new feature. I don't think there is an easy work around for helping typical users model better. Current state of the art is basically to get a PhD in NLP to understand how to write better models.
sign
meets your criteria for 1, 2, and 3.
It's probably the currently unsupported operator that I see most often.
And we already support min
, max
, ifelse
, and abs
, so non-differentiatbility isn't an argument against adding.
@mlubin should weigh in before we decide to merge.
Closes https://github.com/jump-dev/MathOptInterface.jl/issues/2448
I don't know about this one. We might be better off documenting people to write a
signpower
function at the JuMP level because this still has the problem thatsign(x) * abs(x)^p
is not defined whenx=0
andp < 1
.Thoughts @ccoffrin?