increase cost of DualGeoMeanBridge and DualRelativeEntropyBridge - #3062
Closed
araujoms wants to merge 1 commit into
Closed
increase cost of DualGeoMeanBridge and DualRelativeEntropyBridge#3062araujoms wants to merge 1 commit into
araujoms wants to merge 1 commit into
Conversation
Member
|
Here's a reproducible example of what is happening: (hyp) pkg> st
Status `/private/tmp/hyp/Project.toml`
[b99e6be6] Hypatia v0.10.1 `https://github.com/jump-dev/Hypatia.jl.git#araujoms/dualgeomean`
[b8f27783] MathOptInterface v1.53.0 `https://github.com/jump-dev/MathOptInterface.jl.git#od/1.53`
julia> import Hypatia
julia> import MathOptInterface as MOI
julia> begin
model = MOI.instantiate(Hypatia.Optimizer; with_bridge_type = Float64)
x, c = MOI.add_constrained_variables(model, MOI.DualGeometricMeanCone(5))
MOI.Bridges.print_active_bridges(model)
end
* Supported objective: MOI.ScalarAffineFunction{Float64}
* Unsupported constraint: MOI.VectorOfVariables-in-MOI.DualGeometricMeanCone
| bridged by:
| MOIB.Constraint.DualGeoMeanBridge{Float64, MOI.VectorAffineFunction{Float64}, MOI.VectorOfVariables}
| may introduce:
| * Supported constraint: MOI.VectorAffineFunction{Float64}-in-MOI.Nonnegatives
| * Supported constraint: MOI.VectorAffineFunction{Float64}-in-MOI.GeometricMeanCone
julia> begin
model = MOI.instantiate(Hypatia.Optimizer; with_bridge_type = Float64)
MOI.Bridges.remove_bridge(model, MOI.Bridges.Constraint.DualGeoMeanBridge{Float64})
x, c = MOI.add_constrained_variables(model, MOI.DualGeometricMeanCone(5))
MOI.Bridges.print_active_bridges(model)
end
* Supported objective: MOI.ScalarAffineFunction{Float64}
* Unsupported constraint: MOI.VectorOfVariables-in-MOI.DualGeometricMeanCone
| bridged by:
| MOIB.Constraint.FunctionConversionBridge{Float64, MOI.VectorAffineFunction{Float64}, MOI.VectorOfVariables, MOI.DualGeometricMeanCone}
| may introduce:
| * Supported constraint: MOI.VectorAffineFunction{Float64}-in-MOI.DualGeometricMeanConeI wonder if it does make sense to make |
Member
|
This needs some careful thought though, so I'm going to release v1.53 first. The temporary fix for Hypatia is to use a VectorAffineFunction directly. |
Contributor
Author
|
Indeed, I think it makes more sense to make the Closing in favour of #3063. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Otherwise Hypatia uses them instead of FunctionConversionBridge and the supported cones DualGeometricMeanCone and DualRelativeEntropyCones, which is much less efficient.
The reason is that they generate
VectorAffineFunctionconstraints, which Hypatia supports directly.In constrast, Hypatia doesn't use GeoMeanBridge and RelativeEntropyBridge because they introduce VectorOfVariables constraints, which would need a FunctionConversionBridge anyway.
Another possibility would be to reduce the cost of transforming
VectorOfVariablesintoVectorAffineFunction, for example by doingThat works, but I don't know if it has undesirable consequences.