We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
ReverseConstraintFunction
The following errors and it is not clear how to correctly fetch the ReverseConstraintFunction perturbations for conic constraints:
model = JuMP.Model(() -> DiffOpt.diff_optimizer(SCS.Optimizer)) set_silent(model) x = @variable(model) y = @variable(model) t = @variable(model) ceq = @constraint(model, -1.0t == -1.0) cnon = @constraint(model, 1.0y >= 1 / √2) csoc = @constraint(model, [1.0t, 1.0x, 1.0y] in MOI.SecondOrderCone(3)) @objective(model, Min, 1.0x) optimize!(model) MOI.set( model, DiffOpt.ReverseVariablePrimal(), y, 1.0 ) DiffOpt.reverse_differentiate!(model) JuMP.coefficient(MOI.get(model, DiffOpt.ReverseConstraintFunction(), cnon), y)
Errors with:
ERROR: MethodError: no method matching coefficient(::DiffOpt.MatrixVectorAffineFunction{…}, ::MathOptInterface.VariableIndex) Closest candidates are: coefficient(::DiffOpt.MatrixScalarQuadraticFunction, ::MathOptInterface.VariableIndex) @ DiffOpt ~/Workspace/DiffOpt.jl/src/utils.jl:228 coefficient(::DiffOpt.MatrixScalarQuadraticFunction, ::MathOptInterface.VariableIndex, ::MathOptInterface.VariableIndex) @ DiffOpt ~/Workspace/DiffOpt.jl/src/jump_moi_overloads.jl:198 coefficient(::GenericQuadExpr{C, V}, ::V, ::V) where {C, V} @ JuMP ~/.julia/packages/JuMP/xlp0s/src/quad_expr.jl:220 ... Stacktrace: [1] coefficient(func::DiffOpt.IndexMappedFunction{…}, vi::MathOptInterface.VariableIndex) @ DiffOpt ~/Workspace/DiffOpt.jl/src/jump_moi_overloads.jl:247 [2] coefficient(func::DiffOpt.IndexMappedFunction{DiffOpt.IndexMappedFunction{…}}, vi::MathOptInterface.VariableIndex) @ DiffOpt ~/Workspace/DiffOpt.jl/src/jump_moi_overloads.jl:247 [3] coefficient(func::DiffOpt.MOItoJuMP{DiffOpt.IndexMappedFunction{DiffOpt.IndexMappedFunction{…}}}, var_ref::VariableRef) @ DiffOpt ~/Workspace/DiffOpt.jl/src/jump_moi_overloads.jl:297 [4] top-level scope
The text was updated successfully, but these errors were encountered:
@blegat did you think about it at some point?
Sorry, something went wrong.
No branches or pull requests
The following errors and it is not clear how to correctly fetch the
ReverseConstraintFunction
perturbations for conic constraints:Errors with:
The text was updated successfully, but these errors were encountered: