COSMO.jl & Convex.jl: setting intial values

Hi,

I’m using COSMO.jl as a solver from Convex.jl. I’m solving tseveral ‘related problems’ over and over again, which correspond to more precise versions of each others.

I’d like to use the COSMO.jl warm starting features (see there):

warm_start_primal!(model, x_0)
warm_start_dual!(model, y_0)

How can i do the equivalent thing from Convex.jl interface // Through MOI ?
I tried set_value!(x,x_0) but without any luck.

Convex so far only supports warmstarting primal variables, unfortunately. Try passing warmstart=true to solve!. The values are set automatically after the previous solve, or you can set them by hand with set_value!. I have not tried with COSMO, let us know how it goes :slightly_smiling_face:

1 Like

I tried setting them with set_value! and setting warm start to true, it did not work. I’ll write a MWE tomorrow (European time).

1 Like

Ok This MWE seems to show the problem:

using Convex, COSMO


function solve_from_(y0=nothing)
    y = Variable(3)
    x = [1,2,3]
    if !isnothing(y0)
        set_value!(y,y0)
    end
    p = minimize(Convex.norm(y - x,2) + Convex.norm(y,1))
    solve!(p, () -> COSMO.Optimizer(verbose=true),warmstart=true)
    return vec(Convex.evaluate(y))
end

y0 = solve_from_()
solve_from_(y0)

I setted the verbose parameter so we see that COSMO started from the same point both times.

I see the same thing, maybe file an issue with COSMO.jl? Feel free to tag me (@ericphanson) in case there is something going wrong with Convex.

1 Like